Add failure printing to client

Closes #14
This commit is contained in:
Joshua Boniface 2018-07-19 23:19:20 -04:00
parent fab8af9c04
commit 56773d37d8
1 changed files with 6 additions and 0 deletions

6
pvc.py
View File

@ -1279,6 +1279,12 @@ def vm_info(domain, long_output):
information = getInformationFromXML(zk_conn, dom_uuid, long_output)
click.echo(information)
# Get a failure reason if applicable
failedreason = zk_conn.get('/domains/{}/failedreason'.format(dom_uuid))[0].decode('ascii')
if failedreason != '':
click.echo('')
click.echo('{}Failure reason:{} {}'.format(ansiiprint.purple(), ansiiprint.end(), failedreason))
# Close the Zookeeper connection
stopZKConnection(zk_conn)