fixinfg bufgs and tests

This commit is contained in:
Cayo Puigdefabregas 2021-01-14 17:32:46 +01:00
parent d974d3d78f
commit 652273db90

View file

@ -546,7 +546,7 @@ class Snapshot(JoinedWithOneDeviceMixin, ActionWithOneDevice):
def get_last_lifetimes(self): def get_last_lifetimes(self):
"""We get the lifetime and serial_number of the first disk""" """We get the lifetime and serial_number of the first disk"""
hdds = [] hdds = []
components = copy.copy(self.components) components = [c for c in self.components]
components.sort(key=lambda x: x.created) components.sort(key=lambda x: x.created)
for hd in components: for hd in components:
data = {'serial_number': None, 'lifetime': 0} data = {'serial_number': None, 'lifetime': 0}
@ -557,7 +557,7 @@ class Snapshot(JoinedWithOneDeviceMixin, ActionWithOneDevice):
for act in hd.actions: for act in hd.actions:
if not act.type == "TestDataStorage": if not act.type == "TestDataStorage":
continue continue
data['lifetime'] = act.lifetime data['lifetime'] = act.lifetime.total_seconds()
break break
hdds.append(data) hdds.append(data)