Fix missing function when moving metrics from pool_manager to api/v1

Fix dependency function component_to_test for jenkins metrics that was not copied from pool_manager to api/v1 in https://github.com/puppetlabs/vmpooler/pull/455
This commit is contained in:
Jake Spain 2021-08-25 09:27:45 -04:00
parent a28d142f50
commit c88f5d8b5a
No known key found for this signature in database
GPG key ID: BC1C4DA0A085E113
3 changed files with 12 additions and 49 deletions

View file

@ -236,6 +236,18 @@ module Vmpooler
result
end
def component_to_test(match, labels_string)
return if labels_string.nil?
labels_string_parts = labels_string.split(',')
labels_string_parts.each do |part|
key, value = part.split('=')
next if value.nil?
return value if key == match
end
'none'
end
def update_user_metrics(operation, vmname)
backend.multi
backend.hget("vmpooler__vm__#{vmname}", 'tag:jenkins_build_url')

View file

@ -478,18 +478,6 @@ module Vmpooler
dereference_mutex(vm)
end
def component_to_test(match, labels_string)
return if labels_string.nil?
labels_string_parts = labels_string.split(',')
labels_string_parts.each do |part|
key, value = part.split('=')
next if value.nil?
return value if key == match
end
'none'
end
def purge_unused_vms_and_folders
global_purge = $config[:config]['purge_unconfigured_folders']
providers = $config[:providers].keys