Bug 5420 - Remove all uses of sys.exit(1) in tl-setup and related modules
Summary: Remove all uses of sys.exit(1) in tl-setup and related modules
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Server Installer (show other bugs)
Version: 4.3.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.5.0
Assignee: Pierre Ossman
URL:
Keywords: prosaic, samuel_tester
Depends on:
Blocks:
 
Reported: 2015-02-05 09:13 CET by Karl Mikaelsson
Modified: 2015-09-25 13:59 CEST (History)
3 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Karl Mikaelsson cendio 2015-02-05 09:13:22 CET
> ======================================================================
> FAIL: Checks that we don't do sys.exit(1) from tl-setup, since that can
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/autotests/installedtree/test_installedfiles.py", line 491, in test_tlsetup_exit
>     self.assertFalse(self.does_exit_1(fn), "%s does unsafe sys.exit(1)" % fn)
> AssertionError: /opt/thinlinc/modules/thinlinc/firewall.py does unsafe sys.exit(1)
> 
> -------------------------------------------------------------------

The test seems to make sure that nothing in tl-setup does sys.exit(1), because that's how sudo signals errors and we don't want to trigger the sudo error handling if something else goes wrong in tl-setup.
Comment 1 Karl Mikaelsson cendio 2015-02-05 10:56:03 CET
Changes to autotests reverted in r29919. Updating the summary so we can re-introduce the autotest changes when this bug is done.
Comment 2 Pierre Ossman cendio 2015-08-27 11:17:35 CEST
Code fixed in r30703 and autotest reenabled in r30704.
Comment 3 Samuel Mannehed cendio 2015-08-28 16:31:09 CEST
We have one "sys.exit(1)" in:

tlmisc/modules/thinlinc/tlgtk/__init__.py

And since tl-setup uses tlgtk I guess this should be fixed.
Comment 4 Pierre Ossman cendio 2015-08-31 08:51:32 CEST
It is using exit code 1 to be consistent with Python's built in exception handler (which it is trying to emulate).
Comment 5 Henrik Andersson cendio 2015-08-31 12:36:13 CEST
Verified commits and comments #3 and #4. Everything looks good. Closing.

Note You need to log in before you can comment on or make changes to this bug.