Exemplo n.º 1
0
 def vm_uptime(vm, state):
     if state != "active":
         return
     # libvirt doesn't work with openvz
     if conn.getType() == "OpenVZ":
         return openvz.get_uptime(vm.name())
     # uptime in s
     return info[4] / 100000000.0
Exemplo n.º 2
0
 def vm_uptime(vm, state):
     if state != 'active':
         return
     # libvirt doesn't work with openvz
     if conn.getType() == 'OpenVZ':
         return openvz.get_uptime(vm.name())
     # uptime in s
     return info[4] / 100000000.0
Exemplo n.º 3
0
 def vm_uptime(vm, state):
     if state != 'active':
         return
     # libvirt doesn't work with openvz
     if conn.getType() == 'OpenVZ':
         return openvz.get_uptime(vm.name())
     # uptime in s
     return vm.info()[4] / 100000000.0