Updates helper for mutliple types

This commit is contained in:
Josh VanDeraa 2020-11-08 04:02:48 +00:00
parent 07b5080bac
commit 26e14bc8e1

View File

@ -234,6 +234,13 @@ def utilization_graph(utilization, warning_threshold=75, danger_threshold=90):
"""
Display a horizontal bar graph indicating a percentage of utilization.
"""
if isinstance(utilization, int):
return {
'utilization': utilization,
'warning_threshold': warning_threshold,
'danger_threshold': danger_threshold,
}
return {
'utilization': utilization[0],
'warning_threshold': warning_threshold,