mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
(MAINT) Fix Staledns error counter
This was logging the hostname instead of the poolname.
This commit is contained in:
parent
e533223db8
commit
18988ddc3c
2 changed files with 2 additions and 2 deletions
|
|
@ -368,7 +368,7 @@ module Vmpooler
|
||||||
$metrics.increment("errors.duplicatehostname.#{pool_name}")
|
$metrics.increment("errors.duplicatehostname.#{pool_name}")
|
||||||
$logger.log('s', "[!] [#{pool_name}] Generated hostname #{hostname} was not unique (attempt \##{hostname_retries} of #{max_hostname_retries})")
|
$logger.log('s', "[!] [#{pool_name}] Generated hostname #{hostname} was not unique (attempt \##{hostname_retries} of #{max_hostname_retries})")
|
||||||
elsif !dns_available
|
elsif !dns_available
|
||||||
$metrics.increment("errors.staledns.#{hostname}")
|
$metrics.increment("errors.staledns.#{pool_name}")
|
||||||
$logger.log('s', "[!] [#{pool_name}] Generated hostname #{hostname} already exists in DNS records (#{dns_ip}), stale DNS")
|
$logger.log('s', "[!] [#{pool_name}] Generated hostname #{hostname} already exists in DNS records (#{dns_ip}), stale DNS")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -913,7 +913,7 @@ EOT
|
||||||
resolv = class_double("Resolv").as_stubbed_const(:transfer_nested_constants => true)
|
resolv = class_double("Resolv").as_stubbed_const(:transfer_nested_constants => true)
|
||||||
expect(subject).to receive(:generate_and_check_hostname).exactly(3).times.and_return([vm_name, true]) #skip this, make it available all times
|
expect(subject).to receive(:generate_and_check_hostname).exactly(3).times.and_return([vm_name, true]) #skip this, make it available all times
|
||||||
expect(resolv).to receive(:getaddress).exactly(3).times.and_return("1.2.3.4")
|
expect(resolv).to receive(:getaddress).exactly(3).times.and_return("1.2.3.4")
|
||||||
expect(metrics).to receive(:increment).with("errors.staledns.#{vm_name}").exactly(3).times
|
expect(metrics).to receive(:increment).with("errors.staledns.#{pool}").exactly(3).times
|
||||||
expect{subject._clone_vm(pool,provider)}.to raise_error(/Unable to generate a unique hostname after/)
|
expect{subject._clone_vm(pool,provider)}.to raise_error(/Unable to generate a unique hostname after/)
|
||||||
end
|
end
|
||||||
it 'should be successful if DNS does not exist' do
|
it 'should be successful if DNS does not exist' do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue