Merge ~jocave/plainbox-provider-resource:init-category-variable into plainbox-provider-resource:master

Proposed by Jonathan Cave
Status: Merged
Approved by: Jonathan Cave
Approved revision: 99b4f4f5c395e79d035659da750d99cd06ad22de
Merged at revision: cf4037e981948c509246dd9d41ac28dd3ef933c2
Proposed branch: ~jocave/plainbox-provider-resource:init-category-variable
Merge into: plainbox-provider-resource:master
Diff against target: 20 lines (+5/-2)
1 file modified
bin/net_if_management.py (+5/-2)
Reviewer Review Type Date Requested Status
Devices Certification Bot Needs Fixing
Sylvain Pineau (community) Approve
Review via email: mp+369347@code.launchpad.net

Description of the change

Makes sure the category_scope_manager variable is always initialised before being referenced e.g. when there is no netplan config at all.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

+1, thx

review: Approve
Revision history for this message
Devices Certification Bot (ce-certification-qa) wrote :

The merge was fine but running tests failed.

[bionic] [10:26:11] starting container
[xenial] [10:26:12] starting container
Device project added to bionic-testing
Device project added to xenial-testing
[xenial] [10:26:22] provisioning container
[bionic] [10:26:24] provisioning container
[xenial] [10:26:47] Starting tests...
[xenial] Found a test script: ./requirements/container-tests-provider-resource-generic
[bionic] [10:26:47] Starting tests...
[bionic] Found a test script: ./requirements/container-tests-provider-resource-generic
[bionic] [10:28:03] container-tests-provider-resource-generic: FAIL
[xenial] [10:28:03] container-tests-provider-resource-generic: FAIL
[xenial] output: https://paste.ubuntu.com/p/4xNnTMC2t6/
[bionic] output: https://paste.ubuntu.com/p/HTKfyR49XZ/
[xenial] [10:28:06] Fixing file permissions in source directory
[bionic] [10:28:06] Fixing file permissions in source directory
[xenial] [10:28:06] Destroying container
[bionic] [10:28:06] Destroying container

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/net_if_management.py b/bin/net_if_management.py
2index 1b08274..c4604c3 100755
3--- a/bin/net_if_management.py
4+++ b/bin/net_if_management.py
5@@ -89,10 +89,13 @@ def main():
6 print('device: {}'.format(n))
7 print('nmcli_available: {}'.format(nm_conf.available))
8
9+ category_scope_manager = States.unspecified.value
10 if n in netplan_conf.wifis:
11- category_scope_manager = netplan_conf.wifis.get('renderer')
12+ category_scope_manager = netplan_conf.wifis.get(
13+ 'renderer', States.unspecified.value)
14 elif n in netplan_conf.ethernets:
15- category_scope_manager = netplan_conf.ethernets.get('renderer')
16+ category_scope_manager = netplan_conf.ethernets.get(
17+ 'renderer', States.unspecified.value)
18
19 # Netplan config indcates NM
20 if (global_scope_manager == States.nm.value or

Subscribers

People subscribed via source and target branches