curtin exit codes broken by collect_logs misuse of sys.exit
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
Fix Released
|
Undecided
|
Unassigned | ||
curtin (Ubuntu) |
Fix Released
|
High
|
Ryan Harper |
Bug Description
Currently any invocation of curtin that incurs an exception during the 'install' phase will trigger a path which runs the error log collection code.
THere's a bug there which runs sys.exit() in the non-main body of the code; Instead only subcommands _main_ methods should use sys.exit(); the collection method (create_
% git diff
diff --git a/curtin/
index a61d91e..2078f37 100644
--- a/curtin/
+++ b/curtin/
@@ -48,6 +48,7 @@ def collect_
cfg = CONFIG_
create_
+ sys.exit(0)
def create_
@@ -104,7 +105,7 @@ def create_
if os.path.
sys.
- sys.exit(0)
+ return
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: curtin 17.1-37-
ProcVersionSign
Uname: Linux 4.13.0-32-generic x86_64
ApportVersion: 2.20.8-0ubuntu10
Architecture: amd64
Date: Fri Feb 23 02:00:28 2018
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=C.UTF-8
SourcePackage: curtin
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Scott Moser (community): Approve
-
Diff: 68 lines (+5/-13)2 files modifiedcurtin/commands/collect_logs.py (+1/-1)
tests/unittests/test_commands_collect_logs.py (+4/-12)
Changed in curtin (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Ryan Harper (raharper) |
This bug was fixed in the package curtin - 17.1-40- g46f8000f- 0ubuntu1
--------------- g46f8000f- 0ubuntu1) bionic; urgency=medium
curtin (17.1-40-
* New upstream snapshot.
- clear_holders: wipe complex devices before disassembly (LP: #1750519)
- vmtests: network_mtu: fix bug number and move date out one month
- fix /usr/bin/curtin exit code in install failure (LP: #1751176)
-- Scott Moser <email address hidden> Wed, 07 Mar 2018 02:55:23 -0500