diff options
| -rw-r--r-- | nova/compute/disk.py | 7 |
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) |
