Merge ~bladernr/plainbox-provider-resource:1866037-fix-cpuinfo_resource-traceback into plainbox-provider-resource:master

Proposed by Jeff Lane 
Status: Merged
Approved by: Jeff Lane 
Approved revision: 28a04a8d2e8f82cb5f6f50d1c671b9eb3992730c
Merged at revision: f881ad94c119ba01e5510df659f03cf0dddea381
Proposed branch: ~bladernr/plainbox-provider-resource:1866037-fix-cpuinfo_resource-traceback
Merge into: plainbox-provider-resource:master
Diff against target: 16 lines (+4/-1)
1 file modified
bin/cpuinfo_resource (+4/-1)
Reviewer Review Type Date Requested Status
Rod Smith Approve
Review via email: mp+380206@code.launchpad.net

Commit message

Fixes traceback in cpuinfo_resource when attempting to open/read scaling_available_governors on systems where that does not exist.

Description of the change

Fixes traceback in cpuinfo_resource when attempting to open/read scaling_available_governors on systems where that does not exist.

To post a comment you must log in.
Revision history for this message
Rod Smith (rodsmith) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/cpuinfo_resource b/bin/cpuinfo_resource
index 83ce78d..d00eeab 100755
--- a/bin/cpuinfo_resource
+++ b/bin/cpuinfo_resource
@@ -42,7 +42,10 @@ class CpuinfoResult:
42 value = int(value) // 100042 value = int(value) // 1000
43 if value:43 if value:
44 print("%s: %s" % (key, value))44 print("%s: %s" % (key, value))
45 print("governors: %s" % open(GOVERNORS_FILENAME).read().strip())45 try:
46 print("governors: %s" % open(GOVERNORS_FILENAME).read().strip())
47 except FileNotFoundError:
48 print("governors: GOVERNORS NOT FOUND")
4649
4750
48def main():51def main():

Subscribers

People subscribed via source and target branches