Merge ~ogayot/curtin:fix-curthooks-no-kernel into curtin:master
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Olivier Gayot | ||||
Approved revision: | 93d47e95859fc92d5108913fc15b98a0ad56234e | ||||
Merge reported by: | Server Team CI bot | ||||
Merged at revision: | not available | ||||
Proposed branch: | ~ogayot/curtin:fix-curthooks-no-kernel | ||||
Merge into: | curtin:master | ||||
Diff against target: |
43 lines (+16/-6) 2 files modified
curtin/commands/curthooks.py (+7/-6) tests/unittests/test_curthooks.py (+9/-0) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Server Team CI bot | continuous-integration | Approve | |
Dan Bungert | Approve | ||
Review via email: mp+446197@code.launchpad.net |
Commit message
curthooks: fix exception when passing 'kernel: null'
When we don't want curthooks to install a kernel, we can pass:
kernel: null
However, currently, it makes the code raise an exception because we run
.get() on the kernel object even if it is None.
config.
AttributeError: 'NoneType' object has no attribute 'get'
'NoneType' object has no attribute 'get'
Fixed by returning gracefully without installing any kernel upon
encountering this configuration.
LP: #2026225
Signed-off-by: Olivier Gayot <email address hidden>
Description of the change
When we specify 'kernel: null' in the curthooks configuration, curtin raises an exception:
builtin_curthooks
install_
File "/snap/
config.
AttributeError: 'NoneType' object has no attribute 'get'
'NoneType' object has no attribute 'get'
curtin: Installation failed with exception: Unexpected error while running command.
FAILED: Continuous integration, rev:66606faddb9 9576a72e8e2818f 05c40905641410 /jenkins. canonical. com/server- team/job/ curtin- ci/154/ /jenkins. canonical. com/server- team/job/ curtin- ci/nodes= metal-amd64/ 154/ /jenkins. canonical. com/server- team/job/ curtin- ci/nodes= metal-arm64/ 154/ /jenkins. canonical. com/server- team/job/ curtin- ci/nodes= metal-ppc64el/ 154/ /jenkins. canonical. com/server- team/job/ curtin- ci/nodes= metal-s390x/ 154/
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/server- team/job/ curtin- ci/154/ /rebuild
https:/