From 89bfbe1fd8b5deb79b756c951d3c45fe497273c4 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 28 Feb 2025 21:52:42 -0500 Subject: [PATCH] Add translation of domain UUIDs to names Allows frontends to better handle the domain list gracefully, as humans don't care about the UUIDs. --- daemon-common/common.py | 4 ++++ daemon-common/node.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/daemon-common/common.py b/daemon-common/common.py index 0888e989..4f8bc3d5 100644 --- a/daemon-common/common.py +++ b/daemon-common/common.py @@ -1212,3 +1212,7 @@ def get_detect_device(detect_string): return device else: return None + + +def translate_domains_to_names(zkhandler, domain_list): + return list(zkhandler.read_many([("domain.name", d) for d in domain_list])) diff --git a/daemon-common/node.py b/daemon-common/node.py index 0c421ed1..f5270c72 100644 --- a/daemon-common/node.py +++ b/daemon-common/node.py @@ -142,7 +142,9 @@ def getNodeInformation(zkhandler, node_name): node_mem_free = int(_node_mem_free) node_load = float(_node_load) node_domains_count = int(_node_domains_count) - node_running_domains = _node_running_domains.split() + node_running_domains = common.translate_domains_to_names( + zkhandler, _node_running_domains.split() + ) try: node_health = int(_node_health)