summaryrefslogtreecommitdiff
path: root/tests/unittests/test_net.py
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2017-05-13 01:28:14 +0100
committerScott Moser <smoser@brickies.net>2017-05-17 12:28:51 -0400
commita6572d9415e592cbf9821b769bbee9e7fdf029d5 (patch)
tree4aefa462a7353f8de5ac215ba5fa42aba9a6a3d8 /tests/unittests/test_net.py
parent31b6f173280fcc8e9be2732ae2e9b6f6c89679d4 (diff)
downloadvyos-cloud-init-a6572d9415e592cbf9821b769bbee9e7fdf029d5.tar.gz
vyos-cloud-init-a6572d9415e592cbf9821b769bbee9e7fdf029d5.zip
netplan: fix netplan render_network_state signature.
tools/net-convert fails to output netplan config, because the positional arguments of render_network_state are the wrong way around for that function w.r.t. other renders. Fix the netplan renderer to have the correct signature. LP: #1685944
Diffstat (limited to 'tests/unittests/test_net.py')
-rw-r--r--tests/unittests/test_net.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index 052c4016..d36d0e76 100644
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -1073,7 +1073,7 @@ class TestNetplanNetRendering(CiTestCase):
render_target = 'netplan.yaml'
renderer = netplan.Renderer(
{'netplan_path': render_target, 'postcmds': False})
- renderer.render_network_state(render_dir, ns)
+ renderer.render_network_state(ns, render_dir)
self.assertTrue(os.path.exists(os.path.join(render_dir,
render_target)))
@@ -1178,7 +1178,7 @@ class TestNetplanPostcommands(CiTestCase):
render_target = 'netplan.yaml'
renderer = netplan.Renderer(
{'netplan_path': render_target, 'postcmds': True})
- renderer.render_network_state(render_dir, ns)
+ renderer.render_network_state(ns, render_dir)
mock_netplan_generate.assert_called_with(run=True)
mock_net_setup_link.assert_called_with(run=True)
@@ -1203,7 +1203,7 @@ class TestNetplanPostcommands(CiTestCase):
'/sys/class/net/lo'], capture=True),
]
with mock.patch.object(os.path, 'islink', return_value=True):
- renderer.render_network_state(render_dir, ns)
+ renderer.render_network_state(ns, render_dir)
mock_subp.assert_has_calls(expected)
@@ -1354,9 +1354,9 @@ class TestCmdlineReadKernelConfig(CiTestCase):
class TestNetplanRoundTrip(CiTestCase):
def _render_and_read(self, network_config=None, state=None,
- netplan_path=None, dir=None):
- if dir is None:
- dir = self.tmp_dir()
+ netplan_path=None, target=None):
+ if target is None:
+ target = self.tmp_dir()
if network_config:
ns = network_state.parse_net_config_data(network_config)
@@ -1371,8 +1371,8 @@ class TestNetplanRoundTrip(CiTestCase):
renderer = netplan.Renderer(
config={'netplan_path': netplan_path})
- renderer.render_network_state(dir, ns)
- return dir2dict(dir)
+ renderer.render_network_state(ns, target)
+ return dir2dict(target)
def testsimple_render_small_netplan(self):
entry = NETWORK_CONFIGS['small']