cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #02133
[Merge] ~xnox/cloud-init:typeerror into cloud-init:master
Dimitri John Ledkov has proposed merging ~xnox/cloud-init:typeerror into cloud-init:master.
Requested reviews:
cloud init development team (cloud-init-dev)
For more details, see:
https://code.launchpad.net/~xnox/cloud-init/+git/cloud-init/+merge/324012
--
Your team cloud init development team is requested to review the proposed merge of ~xnox/cloud-init:typeerror into cloud-init:master.
diff --git a/cloudinit/net/netplan.py b/cloudinit/net/netplan.py
index 825fe83..56b41be 100644
--- a/cloudinit/net/netplan.py
+++ b/cloudinit/net/netplan.py
@@ -205,7 +205,7 @@ class Renderer(renderer.Renderer):
self._postcmds = config.get('postcmds', False)
self.clean_default = config.get('clean_default', True)
- def render_network_state(self, target, network_state):
+ def render_network_state(self, network_state, target):
# check network state for version
# if v2, then extract network_state.config
# else render_v2_from_state
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index 7c5dc4e..dd9c610 100644
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -1072,7 +1072,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)))
@@ -1177,7 +1177,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)
@@ -1202,7 +1202,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)
@@ -1370,7 +1370,7 @@ class TestNetplanRoundTrip(CiTestCase):
renderer = netplan.Renderer(
config={'netplan_path': netplan_path})
- renderer.render_network_state(dir, ns)
+ renderer.render_network_state(ns, dir)
return dir2dict(dir)
def testsimple_render_small_netplan(self):
Follow ups