refixed bug

This commit is contained in:
Cayo Puigdefabregas 2021-01-14 18:18:59 +01:00
parent d5fffcb561
commit 8b8ff2d2c1
2 changed files with 3 additions and 1 deletions

View File

@ -558,6 +558,8 @@ class Snapshot(JoinedWithOneDeviceMixin, ActionWithOneDevice):
if not act.type == "TestDataStorage":
continue
data['lifetime'] = act.lifetime
if not isinstance(act.lifetime, int):
data['lifetime'] = act.lifetime.total_seconds()
break
hdds.append(data)

View File

@ -346,7 +346,7 @@ class Device(Thing):
if act.type == 'Live':
allocate = copy.copy(allo)
lifetime = act.usage_time_hdd
lifetime = act.usage_time_hdd.total_seconds()
allocate['type'] = 'Live'
allocate['liveCreate'] = act.created
for hd in lifestimes: