Make this even nicer
This commit is contained in:
parent
7901ffb5e3
commit
2fe808f812
|
@ -165,7 +165,7 @@ def getInformationFromXML(zk_conn, uuid):
|
||||||
domain_failedreason = zkhandler.readdata(zk_conn, '/domains/{}/failedreason'.format(uuid))
|
domain_failedreason = zkhandler.readdata(zk_conn, '/domains/{}/failedreason'.format(uuid))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
domain_node_limit = zkhandler.readdata(zk_conn, '/domains/{}/node_limit'.format(uuid)).split(',')
|
domain_node_limit = zkhandler.readdata(zk_conn, '/domains/{}/node_limit'.format(uuid))
|
||||||
except:
|
except:
|
||||||
domain_node_limit = None
|
domain_node_limit = None
|
||||||
try:
|
try:
|
||||||
|
@ -178,9 +178,12 @@ def getInformationFromXML(zk_conn, uuid):
|
||||||
domain_node_autostart = None
|
domain_node_autostart = None
|
||||||
|
|
||||||
if not domain_node_limit:
|
if not domain_node_limit:
|
||||||
domain_node_limit = 'False'
|
domain_node_limit = None
|
||||||
|
else:
|
||||||
|
domain_node_limit = domain_node_limit.split(',')
|
||||||
|
|
||||||
if not domain_node_autostart:
|
if not domain_node_autostart:
|
||||||
domain_node_autostart = 'False'
|
domain_node_autostart = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
domain_profile = zkhandler.readdata(zk_conn, '/domains/{}/profile'.format(uuid))
|
domain_profile = zkhandler.readdata(zk_conn, '/domains/{}/profile'.format(uuid))
|
||||||
|
|
|
@ -749,9 +749,24 @@ def format_info(zk_conn, domain_information, long_output):
|
||||||
ainformation.append('')
|
ainformation.append('')
|
||||||
ainformation.append('{}Failure reason:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['failed_reason']))
|
ainformation.append('{}Failure reason:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['failed_reason']))
|
||||||
|
|
||||||
ainformation.append('{}Migration selector:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['node_selector']))
|
if not domain_information['node_selector']:
|
||||||
ainformation.append('{}Node limit:{} {}'.format(ansiprint.purple(), ansiprint.end(), ', '.join(domain_information['node_limit'])))
|
formatted_node_selector = "False"
|
||||||
ainformation.append('{}Autostart:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['node_autostart']))
|
else:
|
||||||
|
formatted_node_selector = domain_information['node_selector']
|
||||||
|
|
||||||
|
if not domain_information['node_limit']:
|
||||||
|
formatted_node_limit = "False"
|
||||||
|
else:
|
||||||
|
formatted_node_limit = ', '.join(domain_information['node_limit'])
|
||||||
|
|
||||||
|
if not domain_information['node_autostart']:
|
||||||
|
formatted_node_autostart = "False"
|
||||||
|
else:
|
||||||
|
formatted_node_autostart = domain_information['node_autostart']
|
||||||
|
|
||||||
|
ainformation.append('{}Migration selector:{} {}'.format(ansiprint.purple(), ansiprint.end(), formatted_node_selector))
|
||||||
|
ainformation.append('{}Node limit:{} {}'.format(ansiprint.purple(), ansiprint.end(), formatted_node_limit))
|
||||||
|
ainformation.append('{}Autostart:{} {}'.format(ansiprint.purple(), ansiprint.end(), formatted_node_autostart))
|
||||||
|
|
||||||
# Network list
|
# Network list
|
||||||
net_list = []
|
net_list = []
|
||||||
|
|
Loading…
Reference in New Issue