Merge lp:~ben-mendis/wicd/fix-exit-status into lp:wicd/1.6

Proposed by Ben the Pyrate
Status: Merged
Merged at revision: 916
Proposed branch: lp:~ben-mendis/wicd/fix-exit-status
Merge into: lp:wicd/1.6
Diff against target: 27 lines (+6/-0)
1 file modified
cli/wicd-cli.py (+6/-0)
To merge this branch: bzr merge lp:~ben-mendis/wicd/fix-exit-status
Reviewer Review Type Date Requested Status
Pieter Leclerc (community) Approve
Review via email: mp+231407@code.launchpad.net

Description of the change

Exit with a non-zero status (6) when a connection attempt does not succeed.

(This is my first time submitting a pull-request on LP, please let me know if I've gotten the process wrong.)

To post a comment you must log in.
Revision history for this message
Pieter Leclerc (pieterleclerc-deactivatedaccount) wrote :

Tested.

Some comments (a list of the exit codes) would have been nice, and the output (always "done!") is not consistent with the exit code (0 or 6), but it is an improvement over the status quo so I've merged it already. Keep those improvements coming!

review: Approve
Revision history for this message
Pieter Leclerc (pieterleclerc-deactivatedaccount) wrote :

Tested.

Some comments (a list of the exit codes) would have been nice, and the output (always "done!") is not consistent with the exit code (0 or 6), but it is an improvement over the status quo so I've merged it already. Keep those improvements coming!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cli/wicd-cli.py'
2--- cli/wicd-cli.py 2012-11-17 00:07:08 +0000
3+++ cli/wicd-cli.py 2014-08-19 15:59:45 +0000
4@@ -25,6 +25,8 @@
5
6 misc.RenameProcess('wicd-cli')
7
8+exit_status = 0
9+
10 if getattr(dbus, 'version', (0, 0, 0)) < (0, 80, 0):
11 import dbus.glib
12 else:
13@@ -278,6 +280,8 @@
14 print message()
15 last = next_
16 print "done!"
17+ if status() != u'done':
18+ exit_status = 6
19 op_performed = True
20
21 def str_properties(prop):
22@@ -313,3 +317,5 @@
23 if not op_performed:
24 print "No operations performed."
25
26+sys.exit(exit_status)
27+

Subscribers

People subscribed via source and target branches

to status/vote changes: