Merge ~knitzsche/snappy-hwe-snaps/+git/wifi-connect:join-after-fail-regress-1726567 into ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-connect:master

Proposed by Kyle Nitzsche
Status: Merged
Approved by: Roberto Mier Escandon
Approved revision: 58966eccdc594547bc1d3a59e502eeb4c5b174cf
Merged at revision: 1b216ecff0c788ff66b305599b77143bfff4785c
Proposed branch: ~knitzsche/snappy-hwe-snaps/+git/wifi-connect:join-after-fail-regress-1726567
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-connect:master
Diff against target: 74 lines (+10/-8)
5 files modified
scriptlets/country-codes (+0/-0)
scriptlets/fetch_country_codes.sh (+0/-0)
scriptlets/fill_country_codes.sh (+2/-2)
server/handlers.go (+7/-5)
snapcraft.yaml (+1/-1)
Reviewer Review Type Date Requested Status
Roberto Mier Escandon (community) Approve
System Enablement Bot continuous-integration Approve
Review via email: mp+332672@code.launchpad.net

Description of the change

fix https://bugs.launchpad.net/snappy-hwe-snaps/+bug/1726567

A regression that prevents joining AP after a failed attempt to join

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: 58966eccdc594547bc1d3a59e502eeb4c5b174cf

Generated documentation is available at https://jenkins.canonical.com/system-enablement/job/snappy-hwe-snaps-snap-docs/881/

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Roberto Mier Escandon (rmescandon) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snap/scriptlets/country-codes b/scriptlets/country-codes
2index d4e8a97..d4e8a97 100644
3--- a/snap/scriptlets/country-codes
4+++ b/scriptlets/country-codes
5diff --git a/snap/scriptlets/fetch_country_codes.sh b/scriptlets/fetch_country_codes.sh
6index 8dae525..8dae525 100755
7--- a/snap/scriptlets/fetch_country_codes.sh
8+++ b/scriptlets/fetch_country_codes.sh
9diff --git a/snap/scriptlets/fill_country_codes.sh b/scriptlets/fill_country_codes.sh
10index 451c61b..b8babe4 100755
11--- a/snap/scriptlets/fill_country_codes.sh
12+++ b/scriptlets/fill_country_codes.sh
13@@ -6,14 +6,14 @@
14
15 set -e
16
17-COUNTRY_CODES=../../../snap/scriptlets/country-codes
18+COUNTRY_CODES=../../../scriptlets/country-codes
19
20 if [ ! -e $COUNTRY_CODES ]; then
21 echo "======================================================="
22 echo "Could not find country_codes needed file for compiling."
23 echo "Please, before building snap for the first time execute by hand:"
24 echo ""
25- echo "snap/scriptlets/fetch_country_codes.sh"
26+ echo "scriptlets/fetch_country_codes.sh"
27 echo ""
28 echo "======================================================="
29 exit 1
30diff --git a/server/handlers.go b/server/handlers.go
31index c14189f..cb0998d 100644
32--- a/server/handlers.go
33+++ b/server/handlers.go
34@@ -198,10 +198,16 @@ func ConnectHandler(w http.ResponseWriter, r *http.Request) {
35 return
36 }
37
38- //connect
39+ // manage iface by netman
40 netmanClient.SetIfaceManaged("wlan0", true, netmanClient.GetWifiDevices(netmanClient.GetDevices()))
41 _, ap2device, ssid2ap := netmanClient.Ssids()
42
43+ //remove flag file so that daemon starts checking state
44+ //and takes control again
45+ waitPath := os.Getenv("SNAP_COMMON") + "/startingApConnect"
46+ utils.RemoveFlagFile(waitPath)
47+
48+ // attempt to connect to external AP
49 err = netmanClient.ConnectAp(ssid, pwd, ap2device, ssid2ap)
50 //TODO signal user in portal on failure to connect
51 if err != nil {
52@@ -211,10 +217,6 @@ func ConnectHandler(w http.ResponseWriter, r *http.Request) {
53 return
54 }
55
56- //remove flag file so that daemon starts checking state
57- //and takes control again
58- waitPath := os.Getenv("SNAP_COMMON") + "/startingApConnect"
59- utils.RemoveFlagFile(waitPath)
60 }()
61 }
62
63diff --git a/snap/snapcraft.yaml b/snapcraft.yaml
64index 3a7cf44..6826057 100644
65--- a/snap/snapcraft.yaml
66+++ b/snapcraft.yaml
67@@ -56,6 +56,6 @@ parts:
68 assets:
69 plugin: dump
70 source: .
71- prepare: ../../../snap/scriptlets/fill_country_codes.sh
72+ prepare: ../../../scriptlets/fill_country_codes.sh
73 stage:
74 - static

Subscribers

People subscribed via source and target branches