Merge ~b-candler/cloud-init:bridge-parameters into cloud-init:master

Proposed by Brian Candler
Status: Needs review
Proposed branch: ~b-candler/cloud-init:bridge-parameters
Merge into: cloud-init:master
Diff against target: 13 lines (+1/-1)
1 file modified
cloudinit/net/network_state.py (+1/-1)
Reviewer Review Type Date Requested Status
cloud-init Commiters Pending
Review via email: mp+385242@code.launchpad.net

Commit message

Fixes KeyError for bridge with no "parameters:" setting

LP #1879673

Description of the change

Commit ded1ec81 introduced a regression whereby a bridge with no "parameters:" setting caused a KeyError exception.

To post a comment you must log in.
Revision history for this message
Brian Candler (b-candler) wrote :

Note: commit ded1ec81 did include a test case, but didn't test the case where no "parameters:" were provided.
https://git.launchpad.net/cloud-init/commit/?id=ded1ec81

I don't have an environment set up to be able to run the test suite for cloud-init, but someone might want to add the missing test case.

Revision history for this message
Brian Candler (b-candler) wrote :

Unmerged commits

b3cbd5a... by Brian Candler

Fixes KeyError for bridge with no "parameters:" setting

LP #1879673

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py
2index f28973d..4456aea 100644
3--- a/cloudinit/net/network_state.py
4+++ b/cloudinit/net/network_state.py
5@@ -725,7 +725,7 @@ class NetworkStateInterpreter(metaclass=CommandHandlerMeta):
6 # we accept the fixed spelling, but write the old for compatability
7 # Xenial does not have an updated netplan which supports the
8 # correct spelling. LP: #1756701
9- params = item_params['parameters']
10+ params = item_params.get('parameters', {})
11 grat_value = params.pop('gratuitous-arp', None)
12 if grat_value:
13 params['gratuitious-arp'] = grat_value

Subscribers

People subscribed via source and target branches