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
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
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