add get_status
This commit is contained in:
parent
f2a7a15851
commit
0bc75ec547
|
@ -34,3 +34,9 @@ class SnapshotsLog(Thing):
|
||||||
|
|
||||||
if commit:
|
if commit:
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
def get_status(self):
|
||||||
|
if self.severity:
|
||||||
|
return Severity(self.severity)
|
||||||
|
|
||||||
|
return ''
|
||||||
|
|
|
@ -422,7 +422,7 @@ class ParseSnapshotLsHw:
|
||||||
uuid=self.uuid, size=size, sid=self.sid
|
uuid=self.uuid, size=size, sid=self.sid
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.errors(txt)
|
self.errors(txt, severity=Severity.Warning)
|
||||||
return 128
|
return 128
|
||||||
size, units = size.split(" ")
|
size, units = size.split(" ")
|
||||||
return base2.Quantity(float(size), units).to('MiB').m
|
return base2.Quantity(float(size), units).to('MiB').m
|
||||||
|
@ -433,7 +433,7 @@ class ParseSnapshotLsHw:
|
||||||
txt = "Error: Snapshot: {uuid}, tag: {sid} have this ram Speed: {speed}".format(
|
txt = "Error: Snapshot: {uuid}, tag: {sid} have this ram Speed: {speed}".format(
|
||||||
uuid=self.uuid, speed=speed, sid=self.sid
|
uuid=self.uuid, speed=speed, sid=self.sid
|
||||||
)
|
)
|
||||||
self.errors(txt)
|
self.errors(txt, severity=Severity.Warning)
|
||||||
return 100
|
return 100
|
||||||
speed, units = speed.split(" ")
|
speed, units = speed.split(" ")
|
||||||
return float(speed)
|
return float(speed)
|
||||||
|
@ -468,7 +468,7 @@ class ParseSnapshotLsHw:
|
||||||
txt = "Error: Snapshot: {uuid} tag: {sid} have this uuid: {device}".format(
|
txt = "Error: Snapshot: {uuid} tag: {sid} have this uuid: {device}".format(
|
||||||
uuid=self.uuid, device=dmi_uuid, sid=self.sid
|
uuid=self.uuid, device=dmi_uuid, sid=self.sid
|
||||||
)
|
)
|
||||||
self.errors(txt)
|
self.errors(txt, severity=Severity.Warning)
|
||||||
dmi_uuid = None
|
dmi_uuid = None
|
||||||
return dmi_uuid
|
return dmi_uuid
|
||||||
|
|
||||||
|
@ -515,7 +515,7 @@ class ParseSnapshotLsHw:
|
||||||
interface, self.sid
|
interface, self.sid
|
||||||
)
|
)
|
||||||
self.errors("{}".format(err))
|
self.errors("{}".format(err))
|
||||||
self.errors(txt)
|
self.errors(txt, severity=Severity.Warning)
|
||||||
return "ATA"
|
return "ATA"
|
||||||
|
|
||||||
def get_data_storage_size(self, x):
|
def get_data_storage_size(self, x):
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ snap.severity }}
|
{{ snap.get_status() }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ snap.description }}
|
{{ snap.description }}
|
||||||
|
|
Reference in New Issue