diff --git a/client-common/common.py b/client-common/common.py index 49edf6d2..72f7088f 100644 --- a/client-common/common.py +++ b/client-common/common.py @@ -165,7 +165,7 @@ def getInformationFromXML(zk_conn, uuid): domain_failedreason = zkhandler.readdata(zk_conn, '/domains/{}/failedreason'.format(uuid)) 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: domain_node_limit = None try: @@ -178,9 +178,12 @@ def getInformationFromXML(zk_conn, uuid): domain_node_autostart = None 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: - domain_node_autostart = 'False' + domain_node_autostart = None try: domain_profile = zkhandler.readdata(zk_conn, '/domains/{}/profile'.format(uuid)) diff --git a/client-common/vm.py b/client-common/vm.py index e760c3bc..13a0b082 100644 --- a/client-common/vm.py +++ b/client-common/vm.py @@ -749,9 +749,24 @@ def format_info(zk_conn, domain_information, long_output): ainformation.append('') 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'])) - ainformation.append('{}Node limit:{} {}'.format(ansiprint.purple(), ansiprint.end(), ', '.join(domain_information['node_limit']))) - ainformation.append('{}Autostart:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['node_autostart'])) + if not domain_information['node_selector']: + formatted_node_selector = "False" + 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 net_list = []