Merge lp:~chris.gagnon/phablet-tools/fix_1289525 into lp:phablet-tools

Proposed by Chris Gagnon
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 244
Merged at revision: 257
Proposed branch: lp:~chris.gagnon/phablet-tools/fix_1289525
Merge into: lp:phablet-tools
Diff against target: 25 lines (+8/-3)
1 file modified
phablet-network (+8/-3)
To merge this branch: bzr merge lp:~chris.gagnon/phablet-tools/fix_1289525
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
PS Jenkins bot continuous-integration Approve
Andy Doan Pending
Review via email: mp+210007@code.launchpad.net

Commit message

phablet-network: make it work in latest trusty

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

How about not using the find_active_network_again and replacing the original network_file= with
sudo grep -H "$network_active_uuid" /etc/NetworkManager/system-connections/* | grep uuid | cut -f1 -d:

That should return the file that has that uuid; seems less error prone as well.

I'm adding Andy so he can review as well against ci.

There also seems to be some tabbing going on in your changes.

Additionally, the original can be improve if
if [ -z "$network_active_uuid" ]

is done before finding out which network file holds the conf for the uuid.

review: Needs Fixing
243. By Chris Gagnon

add changes from code review

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

7 wireless_adapter="$(nmcli -t -f device,type dev | egrep wireless | cut -d: -f1)"
11 + if [ -z "$wireless_Adapter" ]

s/_Adapter/_adapter/

review: Needs Fixing
Revision history for this message
Andy Doan (doanac) wrote :

CI alway passes a specific file to this command, so we shouldn't touching the code-paths changed here.

244. By Chris Gagnon

fix capitalization

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Works fine on latest trusty; need someone to check on precise.

review: Approve
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

I was able to check in precise, it worked fine in a live usb session after installing adb

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phablet-network'
2--- phablet-network 2013-10-03 15:12:23 +0000
3+++ phablet-network 2014-03-10 04:51:54 +0000
4@@ -87,14 +87,19 @@
5
6 find_active_network() {
7 wireless_adapter="$(nmcli -t -f device,type dev | egrep wireless | cut -d: -f1)"
8- network_active_uuid="$(nmcli -t -f name,uuid,devices,vpn con status | grep $wireless_adapter | egrep ':no$'| cut -d: -f2)"
9- network_file=$(sudo grep "$network_active_uuid" $NETWORK_MANAGER/* | grep uuid | cut -d: -f1)
10-
11+ if [ -z "$wireless_adapter" ]
12+ then
13+ echo "No wireless adapter found, exiting"
14+ exit 1
15+ fi
16+ network_active_uuid="$(nmcli -t -f name,uuid,devices,vpn con status | grep $wireless_adapter | egrep ':no$'| cut -d: -f2)"
17 if [ -z "$network_active_uuid" ]
18 then
19 echo "No active wifi network connection, exiting"
20 exit 1
21 fi
22+ network_file=$(sudo grep -H "$network_active_uuid" /etc/NetworkManager/system-connections/* | grep uuid | cut -f1 -d:)
23+
24 echo "$network_file"
25 }
26

Subscribers

People subscribed via source and target branches