fix server report

This commit is contained in:
Cayo Puigdefabregas 2023-03-09 12:40:46 +01:00
parent de24cae235
commit 6b0110adda
2 changed files with 5 additions and 2 deletions

View file

@ -1097,6 +1097,7 @@ class ExportsView(View):
a, b = self.get_server_erasure_hosts(erasures) a, b = self.get_server_erasure_hosts(erasures)
erasures_host, erasures_on_server = a, b erasures_host, erasures_on_server = a, b
erasures_host = set(erasures_host)
result = 'Success' result = 'Success'
if "Failed" in [e.severity.get_public_name() for e in erasures]: if "Failed" in [e.severity.get_public_name() for e in erasures]:
@ -1104,7 +1105,7 @@ class ExportsView(View):
erasures = sorted(erasures, key=lambda x: x.end_time) erasures = sorted(erasures, key=lambda x: x.end_time)
erasures_on_server = sorted(erasures_on_server, key=lambda x: x.end_time) erasures_on_server = sorted(erasures_on_server, key=lambda x: x.end_time)
erasures_host = sorted(erasures_host, key=lambda x: x.end_time) # import pdb; pdb.set_trace()
erasures_normal = list(set(erasures) - set(erasures_on_server)) erasures_normal = list(set(erasures) - set(erasures_on_server))
erasures_normal = sorted(erasures_normal, key=lambda x: x.end_time) erasures_normal = sorted(erasures_normal, key=lambda x: x.end_time)

View file

@ -366,12 +366,14 @@
<dd>Hid: {{ erasure.parent.hid }}</dd> <dd>Hid: {{ erasure.parent.hid }}</dd>
<dd>Tags: {{ erasure.parent.tags }}</dd> <dd>Tags: {{ erasure.parent.tags }}</dd>
{% if erasure.device.parent %}
<dt>Computer where it resides:</dt> <dt>Computer where it resides:</dt>
<dd>Title: {{ erasure.device.parent.__format__('ts') }}</dd> <dd>Title: {{ erasure.device.parent.__format__('ts') }}</dd>
<dd>DevicehubID: {{ erasure.device.parent.dhid }}</dd> <dd>DevicehubID: {{ erasure.device.parent.dhid }}</dd>
<dd>Hid: {{ erasure.device.parent.hid }}</dd> <dd>Hid: {{ erasure.device.parent.hid }}</dd>
<dd>Tags: {{ erasure.device.parent.tags }}</dd> <dd>Tags: {{ erasure.device.parent.tags }}</dd>
{% endif %} {% endif %}
{% endif %}
<dt>Erasure:</dt> <dt>Erasure:</dt>
<dd>{{ erasure.__format__('ts') }}</dd> <dd>{{ erasure.__format__('ts') }}</dd>