[201911][procdockerstatsd] Fix bug in procdockerstatsd (#7073)

Fix incorrect variable name
This commit is contained in:
pra-moh 2021-03-16 18:41:45 -07:00 committed by GitHub
parent bd07256bfd
commit 5f5644bb93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))