summaryrefslogtreecommitdiff
path: root/cloudinit/net/eni.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-03-16 14:30:15 -0400
committerScott Moser <smoser@brickies.net>2017-03-17 14:41:50 -0400
commita33447344eed897010603b3e8ea1fd122052de76 (patch)
treef155a381238e06fcb412d488951fc3a72c19f455 /cloudinit/net/eni.py
parent1a2ca7530518d819cbab7287b12f942743427e38 (diff)
downloadvyos-cloud-init-a33447344eed897010603b3e8ea1fd122052de76.tar.gz
vyos-cloud-init-a33447344eed897010603b3e8ea1fd122052de76.zip
render_network_state: switch arguments around, do not require target
render_network_state should default to rendering on /. The changes here just make it so render_network_state does not require a target, but defaults to None, and uses target_path to handle that.
Diffstat (limited to 'cloudinit/net/eni.py')
-rw-r--r--cloudinit/net/eni.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/net/eni.py b/cloudinit/net/eni.py
index 69ecbb5d..efa034bf 100644
--- a/cloudinit/net/eni.py
+++ b/cloudinit/net/eni.py
@@ -448,14 +448,14 @@ class Renderer(renderer.Renderer):
return '\n\n'.join(['\n'.join(s) for s in sections]) + "\n"
- def render_network_state(self, target, network_state):
- fpeni = os.path.join(target, self.eni_path)
+ def render_network_state(self, network_state, target=None):
+ fpeni = util.target_path(target, self.eni_path)
util.ensure_dir(os.path.dirname(fpeni))
header = self.eni_header if self.eni_header else ""
util.write_file(fpeni, header + self._render_interfaces(network_state))
if self.netrules_path:
- netrules = os.path.join(target, self.netrules_path)
+ netrules = util.target_path(target, self.netrules_path)
util.ensure_dir(os.path.dirname(netrules))
util.write_file(netrules,
self._render_persistent_net(network_state))
@@ -465,7 +465,7 @@ class Renderer(renderer.Renderer):
links_prefix=self.links_path_prefix)
def _render_systemd_links(self, target, network_state, links_prefix):
- fp_prefix = os.path.join(target, links_prefix)
+ fp_prefix = util.target_path(target, links_prefix)
for f in glob.glob(fp_prefix + "*"):
os.unlink(f)
for iface in network_state.iter_interfaces():