Merge ~alfonsosanchezbeato/snappy-hwe-snaps/+git/network-manager:robust-config-hook into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master

Proposed by Alfonso Sanchez-Beato
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: 7069b5f87bcc81e5d257848190425d2a378a3f2a
Merged at revision: b0a98fa5f188cb8968622454ac95c3b5629bb1ea
Proposed branch: ~alfonsosanchezbeato/snappy-hwe-snaps/+git/network-manager:robust-config-hook
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master
Diff against target: 138 lines (+15/-15)
6 files modified
snap-common/bin/snap-config.sh (+6/-6)
snap-common/bin/snap-prop.sh (+5/-5)
tests/full/no-netplan-default-config/task.yaml (+1/-1)
tests/full/system-network-is-active/task.yaml (+1/-1)
tests/main/conf-ethernet-support/task.yaml (+1/-1)
tests/main/switch-netplan-renderer/task.yaml (+1/-1)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Konrad Zapałowicz (community) code Approve
Review via email: mp+360107@code.launchpad.net

Commit message

Robustify service start:

* Do not fail on error when calling snapctl
* Do not exit on bad configuration

Description of the change

Robustify service start:

* Do not fail on error when calling snapctl
* Do not exit on bad configuration

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: a9d3cd60a9dbc49e7b1caae0d7bfbc71ea071e43

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

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: a9d3cd60a9dbc49e7b1caae0d7bfbc71ea071e43

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

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: a9d3cd60a9dbc49e7b1caae0d7bfbc71ea071e43

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

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: a9d3cd60a9dbc49e7b1caae0d7bfbc71ea071e43

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

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Konrad Zapałowicz (kzapalowicz) :
review: Approve (code)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: a9d3cd60a9dbc49e7b1caae0d7bfbc71ea071e43

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

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: a9d3cd60a9dbc49e7b1caae0d7bfbc71ea071e43

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

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: a9d3cd60a9dbc49e7b1caae0d7bfbc71ea071e43

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

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: cdd805f4b163af82e43c153fc444e0a593875aec

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

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: aad54e1353b267a973ae238294c07bf184b16702

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

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: aad54e1353b267a973ae238294c07bf184b16702

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

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: 9d0a7593e244694f977f06ca2ae34bc0db8e07d9

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

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: 9d0a7593e244694f977f06ca2ae34bc0db8e07d9

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

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: 66738e155e384c91ec6e2ca6fbb12037332fc0e6

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

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: 7069b5f87bcc81e5d257848190425d2a378a3f2a

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

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/snap-common/bin/snap-config.sh b/snap-common/bin/snap-config.sh
2index 3d0b3b9..da60892 100644
3--- a/snap-common/bin/snap-config.sh
4+++ b/snap-common/bin/snap-config.sh
5@@ -22,7 +22,7 @@
6 _replace_file_if_diff() {
7 old_content=
8 if [ -e "$1" ]; then
9- old_content=$(cat "$1")
10+ old_content=$(cat "$1") || true
11 fi
12 if [ "$2" != "$old_content" ]; then
13 echo "Replacing $1"
14@@ -45,7 +45,7 @@ _switch_wifi_powersave() {
15 ;;
16 *)
17 echo "WARNING: invalid value '$1' supplied for wifi.powersave configuration option"
18- exit 1
19+ return
20 ;;
21 esac
22 _replace_file_if_diff "$path" "$content"
23@@ -90,8 +90,8 @@ _switch_wifi_wake_on_wlan() {
24 value=256
25 ;;
26 *)
27- echo "ERROR: Invalid value provided for wifi.wake-on-wlan"
28- exit 1
29+ echo "WARNING: Invalid value provided for wifi.wake-on-wlan"
30+ return
31 ;;
32 esac
33 password=$2
34@@ -124,8 +124,8 @@ _switch_ethernet() {
35 rm -f "$path"
36 ;;
37 *)
38- echo "ERROR: Invalid value provided for ethernet"
39- exit 1
40+ echo "WARNING: Invalid value provided for ethernet"
41+ return
42 esac
43 }
44
45diff --git a/snap-common/bin/snap-prop.sh b/snap-common/bin/snap-prop.sh
46index 8ac560a..3615660 100644
47--- a/snap-common/bin/snap-prop.sh
48+++ b/snap-common/bin/snap-prop.sh
49@@ -17,7 +17,7 @@
50 # Getters for snap properties. They write the current value to stdout.
51
52 get_wifi_powersave() {
53- value=$(snapctl get wifi.powersave)
54+ value=$(snapctl get wifi.powersave) || true
55 if [ -z "$value" ]; then
56 value=disabled
57 fi
58@@ -25,7 +25,7 @@ get_wifi_powersave() {
59 }
60
61 get_wifi_wake_on_wlan() {
62- value=$(snapctl get wifi.wake-on-wlan)
63+ value=$(snapctl get wifi.wake-on-wlan) || true
64 if [ -z "$value" ]; then
65 value=disabled
66 fi
67@@ -33,11 +33,11 @@ get_wifi_wake_on_wlan() {
68 }
69
70 get_wifi_wake_on_password() {
71- snapctl get wifi.wake-on-wlan-password
72+ snapctl get wifi.wake-on-wlan-password || true
73 }
74
75 get_ethernet_enable() {
76- value=$(snapctl get ethernet.enable)
77+ value=$(snapctl get ethernet.enable) || true
78 if [ -z "$value" ]; then
79 # If this file was already present, assume NM is wanted to handle
80 # ethernet in the device. Ideally this should be handled by setting
81@@ -52,7 +52,7 @@ get_ethernet_enable() {
82 }
83
84 get_debug_enable() {
85- value=$(snapctl get debug.enable)
86+ value=$(snapctl get debug.enable) || true
87 if [ -z "$value" ]; then
88 value=false
89 fi
90diff --git a/tests/full/no-netplan-default-config/task.yaml b/tests/full/no-netplan-default-config/task.yaml
91index a412061..b2d2ded 100644
92--- a/tests/full/no-netplan-default-config/task.yaml
93+++ b/tests/full/no-netplan-default-config/task.yaml
94@@ -24,7 +24,7 @@ execute: |
95 # generated from netplan
96 wait_for_network_manager
97 /snap/bin/network-manager.nmcli d | grep 'eth0.*connected'
98- networkctl status eth0 | grep 'State: routable'
99+ networkctl status eth0 | grep unmanaged
100 /snap/bin/network-manager.nmcli c show --active | grep eth0 | grep -v netplan
101
102 # We should only have a single active configuration
103diff --git a/tests/full/system-network-is-active/task.yaml b/tests/full/system-network-is-active/task.yaml
104index 58f3fd2..22d7830 100644
105--- a/tests/full/system-network-is-active/task.yaml
106+++ b/tests/full/system-network-is-active/task.yaml
107@@ -6,4 +6,4 @@ execute: |
108 test -e /etc/netplan/00-default-nm-renderer.yaml
109 wait_for_network_manager
110 /snap/bin/network-manager.nmcli d | grep 'eth0.*connected'
111- networkctl status eth0 | grep 'State: routable'
112+ networkctl status eth0 | grep unmanaged
113diff --git a/tests/main/conf-ethernet-support/task.yaml b/tests/main/conf-ethernet-support/task.yaml
114index 51f75ea..2cba903 100644
115--- a/tests/main/conf-ethernet-support/task.yaml
116+++ b/tests/main/conf-ethernet-support/task.yaml
117@@ -29,7 +29,7 @@ execute: |
118 /snap/bin/network-manager.nmcli d | grep 'eth0.*connected'
119 # ... and we're running with the netplan configuration
120 /snap/bin/network-manager.nmcli d | grep 'netplan-eth0'
121- networkctl status eth0 | grep 'State: routable'
122+ networkctl status eth0 | grep unmanaged
123
124 # Now lets switch back to network by using the configuration
125 # item again and doing another reboot.
126diff --git a/tests/main/switch-netplan-renderer/task.yaml b/tests/main/switch-netplan-renderer/task.yaml
127index 08a73c9..26880bc 100644
128--- a/tests/main/switch-netplan-renderer/task.yaml
129+++ b/tests/main/switch-netplan-renderer/task.yaml
130@@ -22,7 +22,7 @@ execute: |
131
132 # NetworkManager now controls eth0 and networkd does not
133 /snap/bin/network-manager.nmcli d | grep 'eth0.*connected'
134- networkctl status eth0 | grep 'State: routable'
135+ networkctl status eth0 | grep unmanaged
136
137 # And switch back to networkd
138 switch_netplan_to_networkd

Subscribers

People subscribed via source and target branches