diff --git a/files/image_config/procdockerstatsd/procdockerstatsd b/files/image_config/procdockerstatsd/procdockerstatsd index 2216c0744f..abb909cb4a 100755 --- a/files/image_config/procdockerstatsd/procdockerstatsd +++ b/files/image_config/procdockerstatsd/procdockerstatsd @@ -76,13 +76,13 @@ class ProcDockerStats(daemon_base.DaemonBase): value = float(res.groups()[0]) units = res.groups()[1] - if unit.lower() == UNITS_KB.lower(): + if units.lower() == UNITS_KB.lower(): value *= 1000 - elif unit.lower() == UNITS_MB.lower(): + elif units.lower() == UNITS_MB.lower(): value *= (1000 * 1000) - elif unit.lower() == UNITS_MiB.lower(): + elif units.lower() == UNITS_MiB.lower(): value *= (1024 * 1024) - elif unit.lower() == UNITS_GiB.lower(): + elif units.lower() == UNITS_GiB.lower(): value *= (1024 * 1024 * 1024) return int(round(value))