Fix the restore_scaling_governor_states function in site_utils.py
The input scaling governor state with trailing linefeed can not
be set properly, so remove the trailing linefeed before setting.
BUG=chromium:408002
TEST=test on a chromebook device
Change-Id: I1d9b004efd4bc38b2160a054234ba6b7f3185e53
Reviewed-on: https://chromium-review.googlesource.com/214432
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>
Reviewed-by: Ilja Friedel <ihf@chromium.org>
Commit-Queue: Wen-Ding Li <wending@google.com>
Tested-by: Wen-Ding Li <wending@google.com>
diff --git a/client/bin/site_utils.py b/client/bin/site_utils.py
index cb2a75b..f792fe3 100644
--- a/client/bin/site_utils.py
+++ b/client/bin/site_utils.py
@@ -858,7 +858,7 @@
Restores governor states. Inverse operation to get_scaling_governor_states.
"""
for (path, value) in path_value_list:
- cmd = 'echo %s > %s' % (value, path)
+ cmd = 'echo %s > %s' % (value.rstrip('\n'), path)
utils.system(cmd)