summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-06-26 14:50:33 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2010-06-26 14:50:33 -0700
commit543d9792b48909eefe1b3a67e83e0412800c60d7 (patch)
tree8e560dcb561ede8088a901da15fc7304183f1e15
parent8a2f1763cbadd47f6ce26467ac9f82bc9b436d2a (diff)
downloadnova-543d9792b48909eefe1b3a67e83e0412800c60d7.tar.gz
nova-543d9792b48909eefe1b3a67e83e0412800c60d7.tar.xz
nova-543d9792b48909eefe1b3a67e83e0412800c60d7.zip
fix key injection script
-rw-r--r--nova/compute/disk.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/compute/disk.py b/nova/compute/disk.py
index e7090dad3..bd6a010ee 100644
--- a/nova/compute/disk.py
+++ b/nova/compute/disk.py
@@ -36,7 +36,7 @@ from nova import exception
def partition(infile, outfile, local_bytes=0, local_type='ext2', execute=None):
"""Takes a single partition represented by infile and writes a bootable
drive image into outfile.
-
+
The first 63 sectors (0-62) of the resulting image is a master boot record.
Infile becomes the first primary partition.
If local bytes is specified, a second primary partition is created and
@@ -142,5 +142,5 @@ def _inject_into_fs(key, fs, execute=None):
yield execute('sudo chown root %s' % sshdir)
yield execute('sudo chmod 700 %s' % sshdir)
keyfile = os.path.join(sshdir, 'authorized_keys')
- yield execute('sudo bash -c "cat >> %s"' % keyfile, '\n' + key + '\n')
+ yield execute('sudo tee -a %s' % keyfile, '\n' + key.strip() + '\n')