From 5f5644bb932c51491e088f1d13ffec6a57420eea Mon Sep 17 00:00:00 2001 From: pra-moh <49077256+pra-moh@users.noreply.github.com> Date: Tue, 16 Mar 2021 18:41:45 -0700 Subject: [PATCH] [201911][procdockerstatsd] Fix bug in procdockerstatsd (#7073) Fix incorrect variable name --- files/image_config/procdockerstatsd/procdockerstatsd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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))