mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
Syntax fixup for status() method
This commit is contained in:
parent
dff2eb9580
commit
9897a9add1
1 changed files with 12 additions and 12 deletions
|
|
@ -295,13 +295,13 @@ module Vmpooler
|
||||||
else
|
else
|
||||||
result[key]['ok'] = false ##
|
result[key]['ok'] = false ##
|
||||||
|
|
||||||
status 503
|
status(503)
|
||||||
result['ok'] = false
|
result['ok'] = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
status 503
|
status(503)
|
||||||
result['ok'] = false
|
result['ok'] = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -357,12 +357,12 @@ module Vmpooler
|
||||||
else
|
else
|
||||||
result[template]['ok'] = false ##
|
result[template]['ok'] = false ##
|
||||||
|
|
||||||
status 503
|
status(503)
|
||||||
result['ok'] = false
|
result['ok'] = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
status 503
|
status(503)
|
||||||
result['ok'] = false
|
result['ok'] = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -378,13 +378,13 @@ module Vmpooler
|
||||||
|
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
status 404
|
status(404)
|
||||||
result['ok'] = false
|
result['ok'] = false
|
||||||
|
|
||||||
params[:hostname] = hostname_shorten(params[:hostname], Vmpooler::API.settings.config[:config]['domain'])
|
params[:hostname] = hostname_shorten(params[:hostname], Vmpooler::API.settings.config[:config]['domain'])
|
||||||
|
|
||||||
if Vmpooler::API.settings.redis.exists('vmpooler__vm__' + params[:hostname])
|
if Vmpooler::API.settings.redis.exists('vmpooler__vm__' + params[:hostname])
|
||||||
status 200
|
status(200)
|
||||||
result['ok'] = true
|
result['ok'] = true
|
||||||
|
|
||||||
rdata = Vmpooler::API.settings.redis.hgetall('vmpooler__vm__' + params[:hostname])
|
rdata = Vmpooler::API.settings.redis.hgetall('vmpooler__vm__' + params[:hostname])
|
||||||
|
|
@ -420,7 +420,7 @@ module Vmpooler
|
||||||
|
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
status 404
|
status(404)
|
||||||
result['ok'] = false
|
result['ok'] = false
|
||||||
|
|
||||||
params[:hostname] = hostname_shorten(params[:hostname], Vmpooler::API.settings.config[:config]['domain'])
|
params[:hostname] = hostname_shorten(params[:hostname], Vmpooler::API.settings.config[:config]['domain'])
|
||||||
|
|
@ -430,7 +430,7 @@ module Vmpooler
|
||||||
Vmpooler::API.settings.redis.srem('vmpooler__running__' + pool['name'], params[:hostname])
|
Vmpooler::API.settings.redis.srem('vmpooler__running__' + pool['name'], params[:hostname])
|
||||||
Vmpooler::API.settings.redis.sadd('vmpooler__completed__' + pool['name'], params[:hostname])
|
Vmpooler::API.settings.redis.sadd('vmpooler__completed__' + pool['name'], params[:hostname])
|
||||||
|
|
||||||
status 200
|
status(200)
|
||||||
result['ok'] = true
|
result['ok'] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -445,7 +445,7 @@ module Vmpooler
|
||||||
|
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
status 404
|
status(404)
|
||||||
result['ok'] = false
|
result['ok'] = false
|
||||||
|
|
||||||
params[:hostname] = hostname_shorten(params[:hostname], Vmpooler::API.settings.config[:config]['domain'])
|
params[:hostname] = hostname_shorten(params[:hostname], Vmpooler::API.settings.config[:config]['domain'])
|
||||||
|
|
@ -454,7 +454,7 @@ module Vmpooler
|
||||||
begin
|
begin
|
||||||
jdata = JSON.parse(request.body.read)
|
jdata = JSON.parse(request.body.read)
|
||||||
rescue
|
rescue
|
||||||
status 400
|
status(400)
|
||||||
return JSON.pretty_generate(result)
|
return JSON.pretty_generate(result)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -475,7 +475,7 @@ module Vmpooler
|
||||||
end
|
end
|
||||||
|
|
||||||
if failure
|
if failure
|
||||||
status 400
|
status(400)
|
||||||
else
|
else
|
||||||
jdata.each do |param, arg|
|
jdata.each do |param, arg|
|
||||||
case param
|
case param
|
||||||
|
|
@ -490,7 +490,7 @@ module Vmpooler
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
status 200
|
status(200)
|
||||||
result['ok'] = true
|
result['ok'] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue