mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 02:18:41 -05:00
* (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
16 lines
457 B
Ruby
16 lines
457 B
Ruby
# 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
|