diff options
| author | Justin Santa Barbara <justinsb@justinsb-desktop> | 2010-10-14 13:38:35 -0700 |
|---|---|---|
| committer | Justin Santa Barbara <justinsb@justinsb-desktop> | 2010-10-14 13:38:35 -0700 |
| commit | 9732c0af89f21490cc8d6bc80799bbc8b36fb441 (patch) | |
| tree | 0edc878168a59d407223ec753a8611a6d154c798 /nova/compute | |
| parent | d8643f1e15f241db96893d1ea41083a2bee65dbd (diff) | |
| download | nova-9732c0af89f21490cc8d6bc80799bbc8b36fb441.tar.gz nova-9732c0af89f21490cc8d6bc80799bbc8b36fb441.tar.xz nova-9732c0af89f21490cc8d6bc80799bbc8b36fb441.zip | |
Minimized diff, fixed formatting
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/disk.py | 22 | ||||
| -rw-r--r-- | nova/compute/resolv.conf.template | 1 |
2 files changed, 1 insertions, 22 deletions
diff --git a/nova/compute/disk.py b/nova/compute/disk.py index 4ede9a7aa..b1ddb0a1f 100644 --- a/nova/compute/disk.py +++ b/nova/compute/disk.py @@ -87,9 +87,7 @@ def partition(infile, outfile, local_bytes=0, local_type='ext2', execute=None): @defer.inlineCallbacks -def inject_data( image, key=None, net=None, dns=None, - remove_network_udev=False, - partition=None, execute=None): +def inject_data(image, key=None, net=None, partition=None, execute=None): """Injects a ssh key and optionally net data into a disk image. it will mount the image as a fully partitioned disk and attempt to inject @@ -137,11 +135,6 @@ def inject_data( image, key=None, net=None, dns=None, yield _inject_key_into_fs(key, tmpdir, execute=execute) if net: yield _inject_net_into_fs(net, tmpdir, execute=execute) - if dns: - yield _inject_dns_into_fs(dns, tmpdir, execute=execute) - if remove_network_udev: - yield _remove_network_udev(tmpdir, execute=execute) - finally: # unmount device yield execute('sudo umount %s' % mapped_device) @@ -171,16 +164,3 @@ def _inject_net_into_fs(net, fs, execute=None): netfile = os.path.join(fs, 'etc', 'network', 'interfaces') yield execute('sudo tee %s' % netfile, net) -@defer.inlineCallbacks -def _inject_dns_into_fs(dns, fs, execute=None): - dnsfile = os.path.join(fs, 'etc', 'resolv.conf') - yield execute('sudo tee %s' % dnsfile, dns) - -@defer.inlineCallbacks -def _remove_network_udev(fs, execute=None): - # TODO(justinsb): This is correct for Ubuntu, but might not be right for - # other distros. There is a much bigger discussion to be had about what - # we inject and how we inject it. - rulesfile = os.path.join(fs, 'etc', 'udev', 'rules.d', '70-persistent-net.rules') - yield execute('rm -f %s' % rulesfile) - diff --git a/nova/compute/resolv.conf.template b/nova/compute/resolv.conf.template deleted file mode 100644 index 7ddb55190..000000000 --- a/nova/compute/resolv.conf.template +++ /dev/null @@ -1 +0,0 @@ -nameserver ${dns} |
