statusquery returns status dict so we make the normal return looks the same

This commit is contained in:
deflax 2018-04-07 16:38:04 +03:00
parent 9bbc449889
commit b7ccaf04ce

View file

@ -172,16 +172,11 @@ 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':
try:
statusquery = proxobject.nodes(slave_name).qemu(phy_id).status.current.get() statusquery = proxobject.nodes(slave_name).qemu(phy_id).status.current.get()
result = str(statusquery['qmpstatus']) result = {'status': str(statusquery['qmpstatus'])}
except:
result = 'unknown'
if unit_type == 'lxc': if unit_type == 'lxc':
try:
result = proxobject.nodes(slave_name).lxc(phy_id).status.current.get() result = proxobject.nodes(slave_name).lxc(phy_id).status.current.get()
except:
result = 'unknown'
return result return result
def start(json): def start(json):