Some minor tweaks to fix stuff

This commit is contained in:
2018-06-06 00:44:43 -04:00
parent dacce87175
commit f2ec143544
2 changed files with 13 additions and 4 deletions

12
pvcf.py
View File

@ -67,10 +67,14 @@ def stopZKConnection(zk):
#
def getInformationFromXML(zk, uuid, long_output):
# Obtain the contents of the XML from Zookeeper
xml = zk.get('/domains/%s/xml' % uuid)[0].decode('ascii')
dstate = zk.get('/domains/%s/state' % uuid)[0].decode('ascii')
dhypervisor = zk.get('/domains/%s/hypervisor' % uuid)[0].decode('ascii')
dlasthypervisor = zk.get('/domains/%s/lasthypervisor' % uuid)[0].decode('ascii')
try:
xml = zk.get('/domains/%s/xml' % uuid)[0].decode('ascii')
dstate = zk.get('/domains/%s/state' % uuid)[0].decode('ascii')
dhypervisor = zk.get('/domains/%s/hypervisor' % uuid)[0].decode('ascii')
dlasthypervisor = zk.get('/domains/%s/lasthypervisor' % uuid)[0].decode('ascii')
except:
return None
if dlasthypervisor == '':
dlasthypervisor = 'N/A'