summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorTodd Willey <todd@rubidine.com>2010-07-14 19:32:07 -0400
committerTodd Willey <todd@rubidine.com>2010-07-14 19:32:07 -0400
commitb01f71ae7ba387a5e7ff2c6ad4a4775f9ab6e22b (patch)
treeb44acd06b38171b1492fe44a536c2b067b163b79 /nova/compute
parent6bba6d3b7c63054acf7828cba7eb87b0f1d84d1c (diff)
parent5e8337aec03f5a697c90779eb66a457aae4e7ae0 (diff)
Merge branch 'master' into apply_api
Conflicts: nova/compute/node.py nova/volume/storage.py
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/disk.py4
-rw-r--r--nova/compute/node.py14
2 files changed, 10 insertions, 8 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')
diff --git a/nova/compute/node.py b/nova/compute/node.py
index 5b664f82d..8df620a6b 100644
--- a/nova/compute/node.py
+++ b/nova/compute/node.py
@@ -30,7 +30,6 @@ import base64
import json
import logging
import os
-import random
import shutil
import sys
@@ -469,7 +468,7 @@ class Instance(object):
# ensure directories exist and are writable
yield self._pool.simpleExecute('mkdir -p %s' % basepath())
yield self._pool.simpleExecute('chmod 0777 %s' % basepath())
-
+
# TODO(termie): these are blocking calls, it would be great
# if they weren't.
@@ -477,11 +476,11 @@ class Instance(object):
f = open(basepath('libvirt.xml'), 'w')
f.write(libvirt_xml)
f.close()
-
+
if FLAGS.fake_libvirt:
logging.info('fake_libvirt, nothing to do for create_image')
raise defer.returnValue(None);
-
+
if FLAGS.use_s3:
_fetch_file = self._fetch_s3_image
else:
@@ -508,7 +507,7 @@ class Instance(object):
* 1024 * 1024 * 1024)
yield disk.partition(
basepath('disk-raw'), basepath('disk'), bytes, execute=execute)
-
+
@defer.inlineCallbacks
@exception.wrap_exception
def spawn(self):
@@ -519,7 +518,7 @@ class Instance(object):
self.set_state(Instance.NOSTATE, 'launching')
logging.info('self %s', self)
try:
- yield self._create_image(xml)
+ yield self._create_image(xml)
self._conn.createXML(xml, 0)
# TODO(termie): this should actually register
# a callback to check for successful boot
@@ -542,8 +541,11 @@ class Instance(object):
timer.f = _wait_for_boot
timer.start(interval=0.5, now=True)
except Exception, ex:
+<<<<<<< HEAD
# FIXME(todd): this is just for debugging during testing
print "FUUUUUUUUUUUUUUUUUUUUUU: %s" % ex
+=======
+>>>>>>> master
logging.debug(ex)
self.set_state(Instance.SHUTDOWN)