Merge lp:~roadmr/checkbox/923836 into lp:checkbox

Proposed by Daniel Manrique
Status: Merged
Merged at revision: 1205
Proposed branch: lp:~roadmr/checkbox/923836
Merge into: lp:checkbox
Diff against target: 44 lines (+6/-4)
2 files modified
debian/changelog (+3/-1)
scripts/create_connection (+3/-3)
To merge this branch: bzr merge lp:~roadmr/checkbox/923836
Reviewer Review Type Date Requested Status
Marc Tardif (community) Approve
Review via email: mp+90774@code.launchpad.net

Description of the change

This branch updates the command we use to obtain the wireless interface's MAC address, to make it less vulnerable to context changes. Also, if the command fails to get the MAC address, extra logic avoids generating an interface file with an empty mac-address field. Our resident Network Manager expert (cyphermox) is pretty certain that the mac-address field is not even necessary for things to work correctly, which I validated experimentally, so this should still work in all cases.

To post a comment you must log in.
Revision history for this message
Marc Tardif (cr3) wrote :

The *changes* look good, merging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-01-25 19:45:50 +0000
3+++ debian/changelog 2012-01-30 20:15:26 +0000
4@@ -45,6 +45,7 @@
5 passed to the backend for it to add to its environment. (LP: #897889)
6 * Handle malformed LANGUAGE environment variable values (LP: #912946)
7 * Added interactive media_keys_test script.
8+ * Make creation of wireless connection files more robust (LP: #923836)
9
10 [Robert Roth]
11 * Fixed spelling mistakes in user_apps job file. (LP: #904209)
12@@ -67,7 +68,8 @@
13 [ Javier Collado ]
14 * Error while creating binary package fixed (LP: #921576)
15
16- -- Javier Collado <javier.collado@canonical.com> Wed, 25 Jan 2012 14:54:40 +0100
17+
18+ -- Daniel Manrique <daniel.manrique@canonical.com> Mon, 30 Jan 2012 15:09:06 -0500
19
20 checkbox (0.13) precise; urgency=low
21
22
23=== modified file 'scripts/create_connection'
24--- scripts/create_connection 2011-12-23 15:14:33 +0000
25+++ scripts/create_connection 2012-01-30 20:15:26 +0000
26@@ -22,16 +22,16 @@
27 """ % (ssid, uuid)
28
29 # Get MAC address
30- nmcli_proc = Popen("nmcli -f GENERAL dev list | grep 802-11-wireless -A 2 | awk '/HWADDR/ {print $2}'",
31+ nmcli_proc = Popen("nmcli -f GENERAL dev list iface `nmcli dev status | awk '/802-11-wireless/ {print $1}'` | awk '/HWADDR/ {print $2}'",
32 shell=True, stdout=PIPE, stderr=PIPE)
33 (stdout, stderr) = nmcli_proc.communicate()
34+ mac_address_field = "mac-address=%s" % (stdout.strip()) if stdout.strip() != "" else ""
35
36 wireless = """
37 [802-11-wireless]
38 ssid=%s
39 mode=infrastructure
40-mac-address=%s
41- """ % (ssid, stdout.strip())
42+%s """ % (ssid, mac_address_field)
43
44 return connection + wireless
45

Subscribers

People subscribed via source and target branches