From ef86d16f15276581932ab50029e895c9cbf655af Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Wed, 12 Jan 2011 12:29:28 +0100 Subject: Eagerly load fixed_ip property of instances. --- nova/db/sqlalchemy/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 4561fa219..cee6121a9 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -756,12 +756,14 @@ def instance_get_by_id(context, instance_id): if is_admin_context(context): result = session.query(models.Instance).\ options(joinedload('security_groups')).\ + options(joinedload('fixed_ip')).\ filter_by(id=instance_id).\ filter_by(deleted=can_read_deleted(context)).\ first() elif is_user_context(context): result = session.query(models.Instance).\ options(joinedload('security_groups')).\ + options(joinedload('fixed_ip')).\ filter_by(project_id=context.project_id).\ filter_by(id=instance_id).\ filter_by(deleted=False).\ -- cgit From c29fe496c1124369a8b9b77aeee84e8296f964f9 Mon Sep 17 00:00:00 2001 From: Trey Morris Date: Wed, 12 Jan 2011 11:28:05 -0600 Subject: fixed pause and resume --- nova/virt/xenapi/vmops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index e20930fe8..5ca127f36 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -252,7 +252,7 @@ class VMOps(object): raise Exception(_("suspend: instance not present %s") % instance_name) task = self._session.call_xenapi('Async.VM.suspend', vm) - self._wait_with_callback(task, callback) + self._wait_with_callback(instance.id, task, callback) def resume(self, instance, callback): """resume the specified instance""" @@ -262,7 +262,7 @@ class VMOps(object): raise Exception(_("resume: instance not present %s") % instance_name) task = self._session.call_xenapi('Async.VM.resume', vm, False, True) - self._wait_with_callback(task, callback) + self._wait_with_callback(instance.id, task, callback) def get_info(self, instance_id): """Return data about VM instance""" -- cgit From 982067aefcd656de7751623e272d9b6cf1447dc3 Mon Sep 17 00:00:00 2001 From: Todd Willey Date: Wed, 12 Jan 2011 15:12:08 -0500 Subject: Stop error messages for logs when running nova-manage. --- bin/nova-manage | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/nova-manage b/bin/nova-manage index 3f5957190..3e290567c 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -77,12 +77,14 @@ from nova import crypto from nova import db from nova import exception from nova import flags +from nova import log as logging from nova import quota from nova import utils from nova.auth import manager from nova.cloudpipe import pipelib +logging.basicConfig() FLAGS = flags.FLAGS flags.DECLARE('fixed_range', 'nova.network.manager') flags.DECLARE('num_networks', 'nova.network.manager') -- cgit From a58fe1849ad7473f7e437e07611aa9c9611cf5e6 Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Wed, 12 Jan 2011 22:45:44 +0100 Subject: Do joinedload_all('fixed_ip.floating_ips') instead of joinedload('fixed_ip') --- nova/db/sqlalchemy/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index cee6121a9..e00f31cbe 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -756,14 +756,14 @@ def instance_get_by_id(context, instance_id): if is_admin_context(context): result = session.query(models.Instance).\ options(joinedload('security_groups')).\ - options(joinedload('fixed_ip')).\ + options(joinedload_all('fixed_ip.floating_ips')).\ filter_by(id=instance_id).\ filter_by(deleted=can_read_deleted(context)).\ first() elif is_user_context(context): result = session.query(models.Instance).\ options(joinedload('security_groups')).\ - options(joinedload('fixed_ip')).\ + options(joinedload_all('fixed_ip.floating_ips')).\ filter_by(project_id=context.project_id).\ filter_by(id=instance_id).\ filter_by(deleted=False).\ -- cgit