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
1diff --git a/cmd/client/cmd_wizard.go b/cmd/client/cmd_wizard.go
2index b2080bc..2390bd4 100644
3--- a/cmd/client/cmd_wizard.go
4+++ b/cmd/client/cmd_wizard.go
5@@ -45,7 +45,7 @@ const ipv4Offset = net.IPv6len - net.IPv4len
6 var defaultIp = net.IPv4(10, 0, 60, 1)
7
8 // Utility function to read input and strip the trailing \n
9-var readUserInput = func (reader *bufio.Reader) string {
10+var readUserInput = func(reader *bufio.Reader) string {
11 ret, err := reader.ReadString('\n')
12 if err != nil {
13 panic(err)
14@@ -105,7 +105,7 @@ func findFreeSubnet(startIp net.IP) (net.IP, error) {
15
16 func generatePassword(length int) string {
17 // base64 produces 4 byte for every 3 byte of input, rounded up
18- password := make([]byte, length / 4 * 3 + 3)
19+ password := make([]byte, length/4*3+3)
20 rand.Read(password)
21 return base64.StdEncoding.EncodeToString(password)[:length]
22 }
23@@ -127,6 +127,7 @@ var allSteps = [...]wizardStep{
24 return fmt.Errorf("There are no valid wireless network interfaces available")
25 } else if len(ifaces) == 1 {
26 fmt.Println("Automatically selected only available wireless network interface " + ifaces[0])
27+ configuration["wifi.interface"] = ifaces[0]
28 return nil
29 }
30

Subscribers

People subscribed via source and target branches