dom0: return datatime value in get_start_time (#315)
This commit is contained in:
parent
7ae0c52e6d
commit
3c7f8b97cd
@ -534,15 +534,17 @@ class QubesVm(object):
|
|||||||
|
|
||||||
def get_start_time(self):
|
def get_start_time(self):
|
||||||
if not self.is_running():
|
if not self.is_running():
|
||||||
return 0
|
return None
|
||||||
|
|
||||||
dominfo = self.get_xl_dominfo()
|
dominfo = self.get_xl_dominfo()
|
||||||
|
|
||||||
uuid = self.get_uuid()
|
uuid = self.get_uuid()
|
||||||
|
|
||||||
start_time = xs.read('', "/vm/%s/start_time" % str(uuid))
|
start_time = xs.read('', "/vm/%s/start_time" % str(uuid))
|
||||||
|
if start_time != '':
|
||||||
return start_time
|
return datetime.datetime.fromtimestamp(float(start_time))
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
def is_outdated(self):
|
def is_outdated(self):
|
||||||
# Makes sense only on VM based on template
|
# Makes sense only on VM based on template
|
||||||
|
Loading…
Reference in New Issue
Block a user