-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(POOLER-174) Reduce duplicate of on demand code introduced in POOLER-158
(#383) * (POOLER-174) Reduce duplicate of on demand code introduced in POOLER-158 refactored every parsing of request of type 'pool_alias:pool:count' into a utility class, that is used by pool_manager and the api v1 class * add some metrics to the od request generation * fix rubocop offenses, we are now friends
- Loading branch information
Samuel
authored
Jun 11, 2020
1 parent
2afc2a2
commit 4ecd5de
Showing
4 changed files
with
42 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
# utility class shared between apps | ||
module Vmpooler | ||
class Parsing | ||
def self.get_platform_pool_count(requested, &_block) | ||
requested_platforms = requested.split(',') | ||
requested_platforms.each do |platform| | ||
platform_alias, pool, count = platform.split(':') | ||
raise ArgumentError if platform_alias.nil? || pool.nil? || count.nil? | ||
|
||
yield platform_alias, pool, count | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters