summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-03-25 13:34:05 +0000
committerGerrit Code Review <gerrit@baserock.org>2015-03-25 13:34:05 +0000
commit40afdf1b28c497954d615b85cf2a53823723e34a (patch)
tree65a15d57ef2019d021d669b4a6861c07f411bc59
parent2fb5ae89b45b3b98bc9ea631219ece44b4690704 (diff)
parentc7da0c4dd3702d74850f39cf90165898fd970bf6 (diff)
downloaddefinitions-40afdf1b28c497954d615b85cf2a53823723e34a.tar.gz
Merge "simple-network: separate creation of directory and file path"
-rwxr-xr-xsimple-network.configure12
1 files changed, 8 insertions, 4 deletions
diff --git a/simple-network.configure b/simple-network.configure
index 61113325..42bf1b82 100755
--- a/simple-network.configure
+++ b/simple-network.configure
@@ -106,7 +106,10 @@ class SimpleNetworkConfigurationExtension(cliapp.Application):
"""Generate /etc/network/interfaces file"""
iface_file = self.generate_iface_file(stanzas)
- with open(os.path.join(args[0], "etc/network/interfaces"), "w") as f:
+
+ directory_path = os.path.join(args[0], "etc", "network")
+ file_path = os.path.join(directory_path, "interfaces")
+ with open(file_path, "w") as f:
f.write(iface_file)
def generate_iface_file(self, stanzas):
@@ -147,10 +150,11 @@ class SimpleNetworkConfigurationExtension(cliapp.Application):
if iface_file is None:
continue
- path = os.path.join(args[0], "etc", "systemd", "network",
- "%s-%s.network" % (i, stanza['name']))
+ directory_path = os.path.join(args[0], "etc", "systemd", "network")
+ file_path = os.path.join(directory_path,
+ "%s-%s.network" % (i, stanza['name']))
- with open(path, "w") as f:
+ with open(file_path, "w") as f:
f.write(iface_file)
def generate_networkd_file(self, stanza):