Merge ~alfonsosanchezbeato/snappy-hwe-snaps/+git/wifi-ap:fix-wizard into ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master

Proposed by Alfonso Sanchez-Beato
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: fdb4fc4fef23bb5c4a908d7d4899306ee258bb2d
Merged at revision: 676c3610bd74c295212f4f04f8f6f69a27a3afbe
Proposed branch: ~alfonsosanchezbeato/snappy-hwe-snaps/+git/wifi-ap:fix-wizard
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master
Diff against target: 29 lines (+3/-2)
1 file modified
cmd/client/cmd_wizard.go (+3/-2)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Review via email: mp+376189@code.launchpad.net

Commit message

wizard: select properly wifi iface

We were selecting always 'wlan0' as AP interface when there was only one
wifi interface present, so things were not working if the name of that
interface was not wlan0.

Description of the change

wizard: select properly wifi iface

We were selecting always 'wlan0' as AP interface when there was only one
wifi interface present, so things were not working if the name of that
interface was not wlan0.

To test the change, switch the default renderer on a UC18 system:

   snap set network-manager defaultrenderer=true

'networkctl' should show now that all devices are in "unmanaged" state. This will not work on UC16 systems due to a bug in netplan. See https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1855876.

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

PASSED: Successfully build documentation, rev: fdb4fc4fef23bb5c4a908d7d4899306ee258bb2d

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

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/cmd/client/cmd_wizard.go b/cmd/client/cmd_wizard.go
index b2080bc..2390bd4 100644
--- a/cmd/client/cmd_wizard.go
+++ b/cmd/client/cmd_wizard.go
@@ -45,7 +45,7 @@ const ipv4Offset = net.IPv6len - net.IPv4len
45var defaultIp = net.IPv4(10, 0, 60, 1)45var defaultIp = net.IPv4(10, 0, 60, 1)
4646
47// Utility function to read input and strip the trailing \n47// Utility function to read input and strip the trailing \n
48var readUserInput = func (reader *bufio.Reader) string {48var readUserInput = func(reader *bufio.Reader) string {
49 ret, err := reader.ReadString('\n')49 ret, err := reader.ReadString('\n')
50 if err != nil {50 if err != nil {
51 panic(err)51 panic(err)
@@ -105,7 +105,7 @@ func findFreeSubnet(startIp net.IP) (net.IP, error) {
105105
106func generatePassword(length int) string {106func generatePassword(length int) string {
107 // base64 produces 4 byte for every 3 byte of input, rounded up107 // base64 produces 4 byte for every 3 byte of input, rounded up
108 password := make([]byte, length / 4 * 3 + 3)108 password := make([]byte, length/4*3+3)
109 rand.Read(password)109 rand.Read(password)
110 return base64.StdEncoding.EncodeToString(password)[:length]110 return base64.StdEncoding.EncodeToString(password)[:length]
111}111}
@@ -127,6 +127,7 @@ var allSteps = [...]wizardStep{
127 return fmt.Errorf("There are no valid wireless network interfaces available")127 return fmt.Errorf("There are no valid wireless network interfaces available")
128 } else if len(ifaces) == 1 {128 } else if len(ifaces) == 1 {
129 fmt.Println("Automatically selected only available wireless network interface " + ifaces[0])129 fmt.Println("Automatically selected only available wireless network interface " + ifaces[0])
130 configuration["wifi.interface"] = ifaces[0]
130 return nil131 return nil
131 }132 }
132133

Subscribers

People subscribed via source and target branches