From 6fcf4133b49cfefa77151937dec4db097a85c349 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 22 May 2013 17:30:36 -0700 Subject: Use Instance Objects for Start/Stop This patch makes the start and stop operations use the Instance object instead of passing SQLA-derived dicts over RPC. Until something more sophisticated is needed (and developed), it also adds a nova.object.register_all() function which just triggers imports of all the object models so that they are registered. When adding a new object type, that register function should be updated appropriately. Related to bp/unified-object-model Change-Id: I3c8d9cba07d34097a279502062906de802d19d1f --- nova/cmd/compute.py | 6 ++++++ nova/cmd/conductor.py | 2 ++ 2 files changed, 8 insertions(+) (limited to 'nova/cmd') diff --git a/nova/cmd/compute.py b/nova/cmd/compute.py index 0aae286a4..89b7e705a 100644 --- a/nova/cmd/compute.py +++ b/nova/cmd/compute.py @@ -23,9 +23,12 @@ import traceback from oslo.config import cfg +from nova.conductor import rpcapi as conductor_rpcapi from nova import config import nova.db.api from nova import exception +from nova import objects +from nova.objects import base as objects_base from nova.openstack.common import log as logging from nova import service from nova import utils @@ -50,12 +53,15 @@ def block_db_access(): def main(): + objects.register_all() config.parse_args(sys.argv) logging.setup('nova') utils.monkey_patch() if not CONF.conductor.use_local: block_db_access() + objects_base.NovaObject.indirection_api = \ + conductor_rpcapi.ConductorAPI() server = service.Service.create(binary='nova-compute', topic=CONF.compute_topic, diff --git a/nova/cmd/conductor.py b/nova/cmd/conductor.py index b9723f2d2..3fc25eb8c 100644 --- a/nova/cmd/conductor.py +++ b/nova/cmd/conductor.py @@ -21,6 +21,7 @@ import sys from oslo.config import cfg from nova import config +from nova import objects from nova.openstack.common import log as logging from nova import service from nova import utils @@ -30,6 +31,7 @@ CONF.import_opt('topic', 'nova.conductor.api', group='conductor') def main(): + objects.register_all() config.parse_args(sys.argv) logging.setup("nova") utils.monkey_patch() -- cgit