Merge lp:~ralsina/ubuntu-sso-client/fix-939703 into lp:ubuntu-sso-client

Proposed by Roberto Alsina
Status: Merged
Approved by: dobey
Approved revision: 885
Merged at revision: 886
Proposed branch: lp:~ralsina/ubuntu-sso-client/fix-939703
Merge into: lp:ubuntu-sso-client
Diff against target: 32 lines (+6/-4)
2 files modified
ubuntu_sso/networkstate/linux.py (+3/-1)
ubuntu_sso/networkstate/tests/test_linux.py (+3/-3)
To merge this branch: bzr merge lp:~ralsina/ubuntu-sso-client/fix-939703
Reviewer Review Type Date Requested Status
dobey (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+94435@code.launchpad.net

Commit message

Make the network detection code return ONLINE if NM is not available (but still UNKNOWN if it's available and fails)

Description of the change

Make the network detection code return ONLINE if NM is not available (but still UNKNOWN if it's available and fails)

To post a comment you must log in.
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/networkstate/linux.py'
2--- ubuntu_sso/networkstate/linux.py 2012-01-31 20:12:49 +0000
3+++ ubuntu_sso/networkstate/linux.py 2012-02-23 18:47:18 +0000
4@@ -94,7 +94,9 @@
5 if isinstance(error, self.dbus.exceptions.DBusException) and \
6 error.get_dbus_name() == DBUS_UNKNOWN_SERVICE:
7 logger.debug("Network Manager not present")
8- self.call_result_cb(UNKNOWN)
9+ # Assuming since Network Manager is not installed,
10+ # the user has connected in some other way
11+ self.call_result_cb(ONLINE)
12 else:
13 logger.error("Error contacting NetworkManager: %s" % \
14 str(error))
15
16=== modified file 'ubuntu_sso/networkstate/tests/test_linux.py'
17--- ubuntu_sso/networkstate/tests/test_linux.py 2012-01-31 20:12:49 +0000
18+++ ubuntu_sso/networkstate/tests/test_linux.py 2012-02-23 18:47:18 +0000
19@@ -407,10 +407,10 @@
20 self.mocker.result(exc)
21 self.mocker.replay()
22
23- def test_nm_not_running(self):
24- """Check the case when NM is not running."""
25+ def test_nm_not_installed(self):
26+ """Check the case when NM is not installed."""
27 self.connect_proxy(TestNmNotAvailableException)
28- self.check_nm_error(self.assertUnknown, TestNmNotAvailableException())
29+ self.check_nm_error(self.assertOnline, TestNmNotAvailableException())
30
31 def test_dbus_problem(self):
32 """Check the case when DBus throws some other exception."""

Subscribers

People subscribed via source and target branches