utils: fix typo in hwmon
This is the reland of CL:1867752.
Not caching the paths probably caused minor performance issues
in perf tests.
BUG=chromium:1016189
TEST=None
Change-Id: I5bd87e4879d8796e851f000152b9a68dc4b29d10
Reviewed-on: https://chromium-review.googlesource.com/1872819
Tested-by: Po-Hsien Wang <pwang@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
diff --git a/client/bin/utils.py b/client/bin/utils.py
index 8f5fa70..47dd2fa 100644
--- a/client/bin/utils.py
+++ b/client/bin/utils.py
@@ -1863,10 +1863,11 @@
# /sys/class/hwmon/hwmon*/
# /sys/devices/virtual/hwmon/hwmon*/
# /sys/devices/platform/coretemp.0/
+ global _hwmon_paths
if not _hwmon_paths:
cmd = 'find /sys/ -name "' + file_pattern + '"'
- _hwon_paths = utils.run(cmd, verbose=False).stdout.splitlines()
- return _hwon_paths
+ _hwmon_paths = utils.run(cmd, verbose=False).stdout.splitlines()
+ return _hwmon_paths
def get_temperature_critical():