From e87147fc51548c53b494b9b7c700b1e2e8b05975 Mon Sep 17 00:00:00 2001 From: Antoine Millet Date: Fri, 24 Dec 2010 11:49:07 +0100 Subject: [PATCH] Added h and hv tags to hosts and vm. --- ccnode/ccnodehandlers.py | 5 ++++- ccnode/libvirtwrapper.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ccnode/ccnodehandlers.py b/ccnode/ccnodehandlers.py index d02626b..a7cb0ba 100644 --- a/ccnode/ccnodehandlers.py +++ b/ccnode/ccnodehandlers.py @@ -24,7 +24,8 @@ TAG_NOT_FOUND_ERROR = 'Tag %s requested but unknown in node handler' # Hypervisor HV_TAG_MAP = { - 'hostname' : 'get_name', + 'h' : 'get_name', + 'hv' : 'get_name', 'htype' : 'get_hv_type', 'hver' : 'get_hv_version', 'arch' : 'get_arch_type', @@ -40,7 +41,9 @@ HV_TAG_MAP = { # Vm VM_TAG_MAP = { + 'h' : 'get_name', 'vm' : 'get_name', + 'hv' : 'get_hv_name', 'vcpus' : 'get_vcpu', 'status' : 'get_status', 'cpu' : 'get_cpu_percent', diff --git a/ccnode/libvirtwrapper.py b/ccnode/libvirtwrapper.py index 9922a88..01b558b 100644 --- a/ccnode/libvirtwrapper.py +++ b/ccnode/libvirtwrapper.py @@ -127,6 +127,9 @@ class LibvirtVm(VM): def get_name(self): return self._domain.name() + def get_hv_name(self): + return self._hypervisor.get_name() + def get_used_mem(self): return self._domain.info()[2] / KILOBYTE_DIV -- GitLab