summaryrefslogtreecommitdiff
path: root/cloudinit/net/netplan.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2017-07-12 17:16:35 -0700
committerScott Moser <smoser@brickies.net>2017-07-19 07:53:10 -0400
commit865e941f3f88c7daeafbf1eab856e02ce2b6a5f7 (patch)
tree99342a0c9f32295e5315705f3d36a356bf247aea /cloudinit/net/netplan.py
parentd1e8eb73aca6a3f5cee415774dcf540e934ec250 (diff)
downloadvyos-cloud-init-865e941f3f88c7daeafbf1eab856e02ce2b6a5f7.tar.gz
vyos-cloud-init-865e941f3f88c7daeafbf1eab856e02ce2b6a5f7.zip
tests: fixes for issues uncovered when moving to python 3.6.
This includes a few fixes found when testing with python 3.6. - fix eni renderer when target is None This just uses the util.target_path() in the event that target is None. - change test cases to not rely on the cached result of util.get_cmdline() and other cached globals. Update the base TestCase to unset that cache. - mock calls to system_is_snappy from the create_users test cases. - drop unused _pp_root in test_simple_run.py LP: #1703697
Diffstat (limited to 'cloudinit/net/netplan.py')
-rw-r--r--cloudinit/net/netplan.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/net/netplan.py b/cloudinit/net/netplan.py
index 67543305..9f35b72b 100644
--- a/cloudinit/net/netplan.py
+++ b/cloudinit/net/netplan.py
@@ -209,7 +209,8 @@ class Renderer(renderer.Renderer):
# check network state for version
# if v2, then extract network_state.config
# else render_v2_from_state
- fpnplan = os.path.join(target, self.netplan_path)
+ fpnplan = os.path.join(util.target_path(target), self.netplan_path)
+
util.ensure_dir(os.path.dirname(fpnplan))
header = self.netplan_header if self.netplan_header else ""