Merge lp:~mterry/wicd/no-none-in-update-state into lp:wicd

Proposed by Michael Terry on 2012-10-11
Status: Merged
Merged at revision: 818
Proposed branch: lp:~mterry/wicd/no-none-in-update-state
Merge into: lp:wicd
Diff against target: 22 lines (+5/-3)
1 file modified
wicd/monitor.py (+5/-3)
To merge this branch: bzr merge lp:~mterry/wicd/no-none-in-update-state
Reviewer Review Type Date Requested Status
David Paleino 2012-10-11 Pending
Review via email: mp+129289@code.launchpad.net

Description of the change

GetCurrentNetwork and GetCurrentBitrate may return None, but when ConnectionStatus.update_state calls daemon.SetConnectionStatus, it can not afford to have Nones in the argument.

So it should guard against that by using misc.noneToBlankString.

To post a comment you must log in.
David Paleino (dpaleino) wrote :

Thank you, merged in rev. 818!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wicd/monitor.py'
2--- wicd/monitor.py 2011-12-15 18:21:53 +0000
3+++ wicd/monitor.py 2012-10-11 19:46:20 +0000
4@@ -274,13 +274,15 @@
5 if wired.CheckIfWiredConnecting():
6 info = ["wired"]
7 else:
8- info = ["wireless", wireless.GetCurrentNetwork(iwconfig)]
9+ info = ["wireless",
10+ misc.noneToBlankString(wireless.GetCurrentNetwork(iwconfig))]
11 elif state == misc.WIRELESS:
12 self.reconnect_tries = 0
13- info = [str(wifi_ip), wireless.GetCurrentNetwork(iwconfig),
14+ info = [str(wifi_ip),
15+ misc.noneToBlankString(wireless.GetCurrentNetwork(iwconfig)),
16 str(self._get_printable_sig_strength()),
17 str(wireless.GetCurrentNetworkID(iwconfig)),
18- wireless.GetCurrentBitrate(iwconfig)]
19+ misc.noneToBlankString(wireless.GetCurrentBitrate(iwconfig))]
20 elif state == misc.WIRED:
21 self.reconnect_tries = 0
22 info = [str(wired_ip)]

Subscribers

People subscribed via source and target branches

to status/vote changes: