We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdd4c98 commit 8cca552Copy full SHA for 8cca552
checkbox-ng/plainbox/vendor/image_info.py
@@ -157,10 +157,14 @@ def dcd_string_to_info_iot(dcd_string):
157
158
159
def dcd_info():
160
- if DCD_FILE_IOT.is_file():
161
- dcd_string = DCD_FILE_IOT.read_text().strip()
162
- print(f"Found IoT dcd string: {dcd_string}", file=sys.stderr)
163
- return dcd_string_to_info_iot(dcd_string)
+ try:
+ if DCD_FILE_IOT.is_file():
+ with DCD_FILE_IOT.open("r", encoding="utf-8") as f:
+ dcd_string = f.read().strip()
164
+ print("Found IoT dcd string: {}".format(dcd_string), file=sys.stderr)
165
+ return dcd_string_to_info_iot(dcd_string)
166
+ except (IOError, OSError):
167
+ print("IoT dcd file not found. Assuming PC platform", file=sys.stderr)
168
169
ubuntu_report = parse_ubuntu_report()
170
print(
0 commit comments