summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Lane <laner@controller>2010-10-25 23:10:51 +0000
committerRyan Lane <laner@controller>2010-10-25 23:10:51 +0000
commitdfe98891b46c4f02f13ea2686979ca7ff4547bd3 (patch)
tree2a4acee388bc5892aca78aa15e957720a5dc7f88
parentebffd9cb35af4257a085f85abf64e0c2baf31ff0 (diff)
downloadnova-dfe98891b46c4f02f13ea2686979ca7ff4547bd3.tar.gz
nova-dfe98891b46c4f02f13ea2686979ca7ff4547bd3.tar.xz
nova-dfe98891b46c4f02f13ea2686979ca7ff4547bd3.zip
Making net injection create /etc/network if non-existant
-rw-r--r--nova/compute/disk.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/compute/disk.py b/nova/compute/disk.py
index e362b4507..f2e5f8570 100644
--- a/nova/compute/disk.py
+++ b/nova/compute/disk.py
@@ -171,6 +171,9 @@ def _inject_key_into_fs(key, fs, execute=None):
@defer.inlineCallbacks
def _inject_net_into_fs(net, fs, execute=None):
- netfile = os.path.join(os.path.join(os.path.join(
- fs, 'etc'), 'network'), 'interfaces')
+ netdir = os.path.join(os.path.join(fs, 'etc'), 'network')
+ yield execute('sudo mkdir -p %s' % netdir) # existing dir doesn't matter
+ yield execute('sudo chown root:root %s' % netdir)
+ yield execute('sudo chmod 755 %s' % netdir)
+ netfile = os.path.join(netdir, 'interfaces')
yield execute('sudo tee %s' % netfile, net)