add unknown status to the status url
This commit is contained in:
parent
bab37c7cf4
commit
9bbc449889
1 changed files with 9 additions and 3 deletions
12
plugin.py
12
plugin.py
|
@ -172,10 +172,16 @@ def status(json):
|
||||||
#slave_name = proxobject.cluster.status.get()[0]['name']
|
#slave_name = proxobject.cluster.status.get()[0]['name']
|
||||||
ioconfig.logger.info('%s[%s]> status of %s %s (%s)' % (vm_owner, slave_name, unit_type, phy_id, vm_host))
|
ioconfig.logger.info('%s[%s]> status of %s %s (%s)' % (vm_owner, slave_name, unit_type, phy_id, vm_host))
|
||||||
if unit_type == 'kvm':
|
if unit_type == 'kvm':
|
||||||
statusquery = proxobject.nodes(slave_name).qemu(phy_id).status.current.get()
|
try:
|
||||||
result = str(statusquery['qmpstatus'])
|
statusquery = proxobject.nodes(slave_name).qemu(phy_id).status.current.get()
|
||||||
|
result = str(statusquery['qmpstatus'])
|
||||||
|
except:
|
||||||
|
result = 'unknown'
|
||||||
if unit_type == 'lxc':
|
if unit_type == 'lxc':
|
||||||
result = proxobject.nodes(slave_name).lxc(phy_id).status.current.get()
|
try:
|
||||||
|
result = proxobject.nodes(slave_name).lxc(phy_id).status.current.get()
|
||||||
|
except:
|
||||||
|
result = 'unknown'
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def start(json):
|
def start(json):
|
||||||
|
|
Loading…
Reference in a new issue