From 652273db90572918b6bb216b7e285e7554443e00 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 14 Jan 2021 17:32:46 +0100 Subject: [PATCH] fixinfg bufgs and tests --- ereuse_devicehub/resources/action/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index 7dce355b..9c93ef29 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -546,7 +546,7 @@ class Snapshot(JoinedWithOneDeviceMixin, ActionWithOneDevice): def get_last_lifetimes(self): """We get the lifetime and serial_number of the first disk""" hdds = [] - components = copy.copy(self.components) + components = [c for c in self.components] components.sort(key=lambda x: x.created) for hd in components: data = {'serial_number': None, 'lifetime': 0} @@ -557,7 +557,7 @@ class Snapshot(JoinedWithOneDeviceMixin, ActionWithOneDevice): for act in hd.actions: if not act.type == "TestDataStorage": continue - data['lifetime'] = act.lifetime + data['lifetime'] = act.lifetime.total_seconds() break hdds.append(data)