diff options
author | Scott Moser <smoser@brickies.net> | 2017-03-16 14:30:15 -0400 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-03-17 14:41:50 -0400 |
commit | a33447344eed897010603b3e8ea1fd122052de76 (patch) | |
tree | f155a381238e06fcb412d488951fc3a72c19f455 /cloudinit/net/sysconfig.py | |
parent | 1a2ca7530518d819cbab7287b12f942743427e38 (diff) | |
download | vyos-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/sysconfig.py')
-rw-r--r-- | cloudinit/net/sysconfig.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py index 7f52db4a..4eeaaa8a 100644 --- a/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py @@ -389,19 +389,19 @@ class Renderer(renderer.Renderer): contents[iface_cfg.routes.path] = iface_cfg.routes.to_string() return contents - def render_network_state(self, target, network_state): - base_sysconf_dir = os.path.join(target, self.sysconf_dir) + def render_network_state(self, network_state, target=None): + base_sysconf_dir = util.target_path(target, self.sysconf_dir) for path, data in self._render_sysconfig(base_sysconf_dir, network_state).items(): util.write_file(path, data) if self.dns_path: - dns_path = os.path.join(target, self.dns_path) + dns_path = util.target_path(target, self.dns_path) resolv_content = self._render_dns(network_state, existing_dns_path=dns_path) util.write_file(dns_path, resolv_content) if self.netrules_path: netrules_content = self._render_persistent_net(network_state) - netrules_path = os.path.join(target, self.netrules_path) + netrules_path = util.target_path(target, self.netrules_path) util.write_file(netrules_path, netrules_content) # vi: ts=4 expandtab |