Standardize use of nova.db

We already mostly use:
from nova import db
instead of:
import nova.db.api

So change remaining few cases to use nova.db instead of nova.db.api.
Help make code more uniform and easy to work with.

Change-Id: I6183352c4bbe77b88a5b277788f588b0b48c6476
This commit is contained in:
Joe Gordon
2013-07-01 12:46:23 +02:00
parent d891b16473
commit cf34ee9431
11 changed files with 43 additions and 46 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ def find_orphaned_instances(xenapi):
for vm_ref, vm_rec in _get_applicable_vm_recs(xenapi):
try:
uuid = vm_rec['other_config']['nova_uuid']
instance = db.api.instance_get_by_uuid(ctxt, uuid)
instance = db.instance_get_by_uuid(ctxt, uuid)
except (KeyError, exception.InstanceNotFound):
# NOTE(jk0): Err on the side of caution here. If we don't know
# anything about the particular instance, ignore it.