mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
Add invalid templates to result when invalid templates are provided to config endpoint
This commit is contained in:
parent
ab0c5b53a0
commit
6cf12a157e
1 changed files with 9 additions and 4 deletions
|
|
@ -820,7 +820,8 @@ module Vmpooler
|
|||
invalid.each do |bad_template|
|
||||
metrics.increment("config.invalid.#{bad_template}")
|
||||
end
|
||||
status 404
|
||||
result[:bad_templates] = invalid
|
||||
status 400
|
||||
end
|
||||
else
|
||||
metrics.increment('config.invalid.unknown')
|
||||
|
|
@ -846,7 +847,8 @@ module Vmpooler
|
|||
invalid.each do |bad_template|
|
||||
metrics.increment("config.invalid.#{bad_template}")
|
||||
end
|
||||
status 404
|
||||
result[:bad_templates] = invalid
|
||||
status 400
|
||||
end
|
||||
else
|
||||
metrics.increment('config.invalid.unknown')
|
||||
|
|
@ -863,9 +865,12 @@ module Vmpooler
|
|||
|
||||
if pools
|
||||
result = {
|
||||
'ok' => true,
|
||||
'pool configuration' => pools
|
||||
pool_configuration: pools,
|
||||
status: {
|
||||
ok: true
|
||||
}
|
||||
}
|
||||
|
||||
status 200
|
||||
end
|
||||
JSON.pretty_generate(result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue