Loading ccnode/handlers.py +1 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,6 @@ class NodeHandler(RpcHandler): 'h' : self._tag_map_direct('get_name', 24*3600), # one hour # one minute #'cpuremain' : self._tag_map_direct('get_cpu_remain', -1), 'memfree' : self._tag_map_direct('get_mem_free', 60), 'memused' : self._tag_map_direct('get_mem_used', 60), 'sto' : ( lambda o: hasattr(o, 'storage'), Loading Loading @@ -128,6 +127,7 @@ class NodeHandler(RpcHandler): # one hour 'cpu' : self._tag_map_direct('get_cpu_core', 3600), 'mem' : self._tag_map_direct('get_mem', 3600), 'vncport' : self._tag_map_direct('get_vnc_port', 3600), # one minute # 5 seconds 'status' : ( lambda o: True, Loading ccnode/libvirtwrapper.py +16 −0 Original line number Diff line number Diff line Loading @@ -663,6 +663,22 @@ class LibvirtVm(VM): ''' return (self.get_mem() - self.get_mem_used()) * KILOBYTE_DIV def get_vnc_port(self): ''' ''' port = None try: xroot = xml.dom.minidom.parseString( self._domain.XMLDesc(libvirt.VIR_DOMAIN_XML_INACTIVE)) xdomain = xroot.getElementsByTagName('domain').pop() xgraphics = xdomain.getElementsByTagName('graphics').pop() data = xgraphics.getAttribute('port') if data > 0 and data <= 65535: port = data except: pass return port def get_volumes(self): ''' ''' Loading Loading
ccnode/handlers.py +1 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,6 @@ class NodeHandler(RpcHandler): 'h' : self._tag_map_direct('get_name', 24*3600), # one hour # one minute #'cpuremain' : self._tag_map_direct('get_cpu_remain', -1), 'memfree' : self._tag_map_direct('get_mem_free', 60), 'memused' : self._tag_map_direct('get_mem_used', 60), 'sto' : ( lambda o: hasattr(o, 'storage'), Loading Loading @@ -128,6 +127,7 @@ class NodeHandler(RpcHandler): # one hour 'cpu' : self._tag_map_direct('get_cpu_core', 3600), 'mem' : self._tag_map_direct('get_mem', 3600), 'vncport' : self._tag_map_direct('get_vnc_port', 3600), # one minute # 5 seconds 'status' : ( lambda o: True, Loading
ccnode/libvirtwrapper.py +16 −0 Original line number Diff line number Diff line Loading @@ -663,6 +663,22 @@ class LibvirtVm(VM): ''' return (self.get_mem() - self.get_mem_used()) * KILOBYTE_DIV def get_vnc_port(self): ''' ''' port = None try: xroot = xml.dom.minidom.parseString( self._domain.XMLDesc(libvirt.VIR_DOMAIN_XML_INACTIVE)) xdomain = xroot.getElementsByTagName('domain').pop() xgraphics = xdomain.getElementsByTagName('graphics').pop() data = xgraphics.getAttribute('port') if data > 0 and data <= 65535: port = data except: pass return port def get_volumes(self): ''' ''' Loading