diff options
| author | Dan Smith <danms@us.ibm.com> | 2013-05-22 17:30:36 -0700 |
|---|---|---|
| committer | Dan Smith <danms@us.ibm.com> | 2013-06-07 11:43:37 -0700 |
| commit | 6fcf4133b49cfefa77151937dec4db097a85c349 (patch) | |
| tree | 07436a73fb8f9ff6b154ffde59aaba52c3078072 /nova/cmd | |
| parent | e86d5b063bbb741d411bf4b50b5cc8a9829960db (diff) | |
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
Diffstat (limited to 'nova/cmd')
| -rw-r--r-- | nova/cmd/compute.py | 6 | ||||
| -rw-r--r-- | nova/cmd/conductor.py | 2 |
2 files changed, 8 insertions, 0 deletions
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() |
