Merge ~zongminl/plainbox-provider-checkbox:fix-1953294-missing-exception-handling into plainbox-provider-checkbox:master
Proposed by
Vic Liu
Status: | Merged |
---|---|
Approved by: | Vic Liu |
Approved revision: | b1754cb94eaf1e495039ca9bddedff8527b9d240 |
Merged at revision: | 3faee4c5045f54d055828a62e642f7ea2e032298 |
Proposed branch: | ~zongminl/plainbox-provider-checkbox:fix-1953294-missing-exception-handling |
Merge into: | plainbox-provider-checkbox:master |
Diff against target: |
40 lines (+11/-3) 1 file modified
bin/boot_mode_test_snappy.py (+11/-3) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Devices Certification Bot | Needs Fixing | ||
Pierre Equoy | Approve | ||
Review via email: mp+412834@code.launchpad.net |
Commit message
Fix: lp1953294 - miscellanea/
- Added exception handler so a SystemExit can be raised when CalledProcessError occurs
- Skipped the volume in gadget.yaml when there is no 'bootloader' defined in it to avoid KeyError
To post a comment you must log in.
Thanks for your help!
It now outputs this:
-----
Bootloader is grub
+ mokutil --sb-state bvvsju26. 648efd11d9fcfc5 a24433b6c16a3b5 4cc18049637438a b18211e9597782a a0e1/boot_ mode_test_ snappy. py:77: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https:/ /msg.pyyaml. org/load for full details.
This system doesn't support Secure Boot
/tmp/nest-
data = yaml.load(f)
Error: Command 'mokutil --sb-state' returned non-zero exit status 255.
-----
I think there is a fix to be made to the `data = yaml.load(f)` (line 19 below) to avoid showing the DeprecationWarning, and as for the command itself, maybe we should just run the command, since `mokutil --sb-state` already outputs "This system doesn't support Secure Boot" by default:
>>> import subprocess run("mokutil --sb-state" .split( ))
>>> p = subprocess.
This system doesn't support Secure Boot
>>> p.stderr
>>> p.stdout
>>> p.args
['mokutil', '--sb-state']
>>> p.returncode
255