diff --git a/client-cli/pvc/lib/vm.py b/client-cli/pvc/lib/vm.py index b2690cd9..86fddfc1 100644 --- a/client-cli/pvc/lib/vm.py +++ b/client-cli/pvc/lib/vm.py @@ -1659,24 +1659,26 @@ def format_info(config, domain_information, long_output): ) if not domain_information.get("node_selector"): - formatted_node_selector = "False" + formatted_node_selector = "Default" else: - formatted_node_selector = domain_information["node_selector"] + formatted_node_selector = str(domain_information["node_selector"]).title() if not domain_information.get("node_limit"): - formatted_node_limit = "False" + formatted_node_limit = "Any" else: formatted_node_limit = ", ".join(domain_information["node_limit"]) if not domain_information.get("node_autostart"): + autostart_colour = ansiprint.blue() formatted_node_autostart = "False" else: - formatted_node_autostart = domain_information["node_autostart"] + autostart_colour = ansiprint.green() + formatted_node_autostart = "True" if not domain_information.get("migration_method"): - formatted_migration_method = "any" + formatted_migration_method = "Any" else: - formatted_migration_method = domain_information["migration_method"] + formatted_migration_method = str(domain_information["migration_method"]).title() ainformation.append( "{}Migration selector:{} {}".format( @@ -1689,8 +1691,12 @@ def format_info(config, domain_information, long_output): ) ) ainformation.append( - "{}Autostart:{} {}".format( - ansiprint.purple(), ansiprint.end(), formatted_node_autostart + "{}Autostart:{} {}{}{}".format( + ansiprint.purple(), + ansiprint.end(), + autostart_colour, + formatted_node_autostart, + ansiprint.end(), ) ) ainformation.append( @@ -1736,13 +1742,17 @@ def format_info(config, domain_information, long_output): domain_information["tags"], key=lambda t: t["type"] + t["name"] ): ainformation.append( - " {tags_name: <{tags_name_length}} {tags_type: <{tags_type_length}} {tags_protected: <{tags_protected_length}}".format( + " {tags_name: <{tags_name_length}} {tags_type: <{tags_type_length}} {tags_protected_colour}{tags_protected: <{tags_protected_length}}{end}".format( tags_name_length=tags_name_length, tags_type_length=tags_type_length, tags_protected_length=tags_protected_length, tags_name=tag["name"], tags_type=tag["type"], tags_protected=str(tag["protected"]), + tags_protected_colour=ansiprint.green() + if tag["protected"] + else ansiprint.blue(), + end=ansiprint.end(), ) ) else: diff --git a/daemon-common/common.py b/daemon-common/common.py index 1119d8dd..2451817d 100644 --- a/daemon-common/common.py +++ b/daemon-common/common.py @@ -422,19 +422,34 @@ def getDomainMetadata(zkhandler, dom_uuid): The UUID must be validated before calling this function! """ - domain_node_limit = zkhandler.read(("domain.meta.node_limit", dom_uuid)) - domain_node_selector = zkhandler.read(("domain.meta.node_selector", dom_uuid)) - domain_node_autostart = zkhandler.read(("domain.meta.autostart", dom_uuid)) - domain_migration_method = zkhandler.read(("domain.meta.migrate_method", dom_uuid)) + ( + domain_node_limit, + domain_node_selector, + domain_node_autostart, + domain_migration_method, + ) = zkhandler.read_many( + [ + ("domain.meta.node_limit", dom_uuid), + ("domain.meta.node_selector", dom_uuid), + ("domain.meta.autostart", dom_uuid), + ("domain.meta.migrate_method", dom_uuid), + ] + ) if not domain_node_limit: domain_node_limit = None else: domain_node_limit = domain_node_limit.split(",") + if not domain_node_selector or domain_node_selector == "none": + domain_node_selector = None + if not domain_node_autostart: domain_node_autostart = None + if not domain_migration_method or domain_migration_method == "none": + domain_migration_method = None + return ( domain_node_limit, domain_node_selector, diff --git a/images/4-vm-information.png b/images/4-vm-information.png index 266c61f7..afef6019 100644 Binary files a/images/4-vm-information.png and b/images/4-vm-information.png differ diff --git a/images/5-vm-details.png b/images/5-vm-details.png index 344088b0..ed1c6b44 100644 Binary files a/images/5-vm-details.png and b/images/5-vm-details.png differ