Skip to content

Commit

Permalink
net: ignore 'renderer' key in netplan config (#306)
Browse files Browse the repository at this point in the history
LP: #1870421
  • Loading branch information
raharper committed Apr 3, 2020
1 parent 723e2bc commit 09fea85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cloudinit/net/network_state.py
Expand Up @@ -312,7 +312,7 @@ def parse_config_v1(self, skip_broken=True):

def parse_config_v2(self, skip_broken=True):
for command_type, command in self._config.items():
if command_type == 'version':
if command_type in ['version', 'renderer']:
continue
try:
handler = self.command_handlers[command_type]
Expand Down
10 changes: 10 additions & 0 deletions cloudinit/net/tests/test_network_state.py
Expand Up @@ -45,4 +45,14 @@ def test_empty_v2_config_gets_network_state(self):
self.assertNotEqual(None, result)


class TestNetworkStateParseConfigV2(CiTestCase):

def test_version_2_ignores_renderer_key(self):
ncfg = {'version': 2, 'renderer': 'networkd', 'ethernets': {}}
nsi = network_state.NetworkStateInterpreter(version=ncfg['version'],
config=ncfg)
nsi.parse_config(skip_broken=False)
self.assertEqual(ncfg, nsi.as_dict()['config'])


# vi: ts=4 expandtab

0 comments on commit 09fea85

Please sign in to comment.