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

Proposed by Michael Terry
Status: Merged
Merged at revision: 818
Proposed branch: lp:~mterry/wicd/no-none-in-update-state
Merge into: lp:wicd/1.6
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 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.
Revision history for this message
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
=== modified file 'wicd/monitor.py'
--- wicd/monitor.py 2011-12-15 18:21:53 +0000
+++ wicd/monitor.py 2012-10-11 19:46:20 +0000
@@ -274,13 +274,15 @@
274 if wired.CheckIfWiredConnecting():274 if wired.CheckIfWiredConnecting():
275 info = ["wired"]275 info = ["wired"]
276 else:276 else:
277 info = ["wireless", wireless.GetCurrentNetwork(iwconfig)]277 info = ["wireless",
278 misc.noneToBlankString(wireless.GetCurrentNetwork(iwconfig))]
278 elif state == misc.WIRELESS:279 elif state == misc.WIRELESS:
279 self.reconnect_tries = 0280 self.reconnect_tries = 0
280 info = [str(wifi_ip), wireless.GetCurrentNetwork(iwconfig),281 info = [str(wifi_ip),
282 misc.noneToBlankString(wireless.GetCurrentNetwork(iwconfig)),
281 str(self._get_printable_sig_strength()),283 str(self._get_printable_sig_strength()),
282 str(wireless.GetCurrentNetworkID(iwconfig)),284 str(wireless.GetCurrentNetworkID(iwconfig)),
283 wireless.GetCurrentBitrate(iwconfig)]285 misc.noneToBlankString(wireless.GetCurrentBitrate(iwconfig))]
284 elif state == misc.WIRED:286 elif state == misc.WIRED:
285 self.reconnect_tries = 0287 self.reconnect_tries = 0
286 info = [str(wired_ip)]288 info = [str(wired_ip)]

Subscribers

People subscribed via source and target branches

to status/vote changes: