summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoren Hansen <soren.hansen@rackspace.com>2010-10-15 23:55:43 +0200
committerSoren Hansen <soren.hansen@rackspace.com>2010-10-15 23:55:43 +0200
commit5bb507fc0375e0e4dc7b8448b6751dcc52fc75eb (patch)
treece07cd6bc4a760fb836bd02b215ee1f1a7b6bb2d
parentb70742cd442e8477d15c82a825641d934529bedf (diff)
downloadnova-5bb507fc0375e0e4dc7b8448b6751dcc52fc75eb.tar.gz
nova-5bb507fc0375e0e4dc7b8448b6751dcc52fc75eb.tar.xz
nova-5bb507fc0375e0e4dc7b8448b6751dcc52fc75eb.zip
Fix two problems with get_console_log:
libvirt has this annoying "feature" where it chown()s your console to the uid running libvirt. That gets in the way of reading it. We were looking in the wrong directory for console.log. *blush*
-rw-r--r--nova/virt/libvirt_conn.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py
index d8d36ff65..58a5a941c 100644
--- a/nova/virt/libvirt_conn.py
+++ b/nova/virt/libvirt_conn.py
@@ -285,16 +285,15 @@ class LibvirtConnection(object):
@exception.wrap_exception
def get_console_output(self, instance):
- console_log = os.path.join(FLAGS.instances_path, instance['internal_id'], 'console.log')
- logging.info('console_log: %s' % console_log)
- logging.info('FLAGS.libvirt_type: %s' % FLAGS.libvirt_type)
+ console_log = os.path.join(FLAGS.instances_path, instance['name'], 'console.log')
+ d = process.simple_execute('sudo chown %d %s' % (os.getuid(), console_log))
if FLAGS.libvirt_type == 'xen':
# Xen is spethial
- d = process.simple_execute("virsh ttyconsole %s" % instance['name'])
+ d.addCallback(lambda _: process.simple_execute("virsh ttyconsole %s" % instance['name']))
d.addCallback(self._flush_xen_console)
d.addCallback(self._append_to_file, console_log)
else:
- d = defer.succeed(console_log)
+ d.addCallback(lambda _: defer.succeed(console_log))
d.addCallback(self._dump_file)
return d