summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-03-25 13:34:12 (GMT)
committerGerrit Code Review <gerrit@baserock.org>2015-03-25 13:34:12 (GMT)
commit2f8dd7c1f603799c1dfde512c9e160d8fb9d02f4 (patch)
tree0b1671b45695eca7f03369635480db36603fd8dd
parent3723e04ade96aee6a2bc0a13387aa46e5b2718b5 (diff)
parent6e276cac1ab281cdf14f3a918d10cb65ce9e6c50 (diff)
downloadmorph-2f8dd7c1f603799c1dfde512c9e160d8fb9d02f4.tar.gz
Merge "simple-network: Use function to ensure directory path will exist"
-rwxr-xr-xmorphlib/exts/simple-network.configure2
1 files changed, 2 insertions, 0 deletions
diff --git a/morphlib/exts/simple-network.configure b/morphlib/exts/simple-network.configure
index b498812..130b96c 100755
--- a/morphlib/exts/simple-network.configure
+++ b/morphlib/exts/simple-network.configure
@@ -109,6 +109,7 @@ class SimpleNetworkConfigurationExtension(cliapp.Application):
iface_file = self.generate_iface_file(stanzas)
directory_path = os.path.join(args[0], "etc", "network")
+ self.make_sure_path_exists(directory_path)
file_path = os.path.join(directory_path, "interfaces")
with open(file_path, "w") as f:
f.write(iface_file)
@@ -152,6 +153,7 @@ class SimpleNetworkConfigurationExtension(cliapp.Application):
continue
directory_path = os.path.join(args[0], "etc", "systemd", "network")
+ self.make_sure_path_exists(directory_path)
file_path = os.path.join(directory_path,
"%s-%s.network" % (i, stanza['name']))