Merge ~alfonsosanchezbeato/snappy-hwe-snaps/+git/network-manager:robust-config-hook into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master
- Git
- lp:~alfonsosanchezbeato/snappy-hwe-snaps/+git/network-manager
- robust-config-hook
- Merge into master
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) |
Related bugs: |
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
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:a9d3cd60a9d
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: a9d3cd60a9dbc49
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:a9d3cd60a9d
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: a9d3cd60a9dbc49
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:a9d3cd60a9d
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: a9d3cd60a9dbc49
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:a9d3cd60a9d
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Konrad Zapałowicz (kzapalowicz) : | # |
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: a9d3cd60a9dbc49
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:a9d3cd60a9d
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: a9d3cd60a9dbc49
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:a9d3cd60a9d
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: a9d3cd60a9dbc49
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:a9d3cd60a9d
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: cdd805f4b163af8
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:cdd805f4b16
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: aad54e1353b267a
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:aad54e1353b
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: aad54e1353b267a
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:aad54e1353b
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: 9d0a7593e244694
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:9d0a7593e24
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: 9d0a7593e244694
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:9d0a7593e24
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: 66738e155e384c9
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:66738e155e3
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Successfully build documentation, rev: 7069b5f87bcc81e
Generated documentation is available at https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:7069b5f87bc
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | diff --git a/snap-common/bin/snap-config.sh b/snap-common/bin/snap-config.sh |
2 | index 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 | |
45 | diff --git a/snap-common/bin/snap-prop.sh b/snap-common/bin/snap-prop.sh |
46 | index 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 |
90 | diff --git a/tests/full/no-netplan-default-config/task.yaml b/tests/full/no-netplan-default-config/task.yaml |
91 | index 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 |
103 | diff --git a/tests/full/system-network-is-active/task.yaml b/tests/full/system-network-is-active/task.yaml |
104 | index 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 |
113 | diff --git a/tests/main/conf-ethernet-support/task.yaml b/tests/main/conf-ethernet-support/task.yaml |
114 | index 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. |
126 | diff --git a/tests/main/switch-netplan-renderer/task.yaml b/tests/main/switch-netplan-renderer/task.yaml |
127 | index 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 |
PASSED: Successfully build documentation, rev: a9d3cd60a9dbc49 e7b1caae0d7bfbc 71ea071e43
Generated documentation is available at https:/ /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-docs/ 1135/