summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-09 02:12:18 +0000
committerGerrit Code Review <review@openstack.org>2013-01-09 02:12:18 +0000
commitdb3da2d95626ed25ed8fc925662a5a17dc7d32a2 (patch)
tree5f9bcd8d81339edfaf2a23deff1fdaab4675e078
parentf4091e9eb8813fa005051b9e1524a24b9589e5d4 (diff)
parent14fcded53ded17a1c10325453c2e04458955301f (diff)
downloadnova-db3da2d95626ed25ed8fc925662a5a17dc7d32a2.tar.gz
nova-db3da2d95626ed25ed8fc925662a5a17dc7d32a2.tar.xz
nova-db3da2d95626ed25ed8fc925662a5a17dc7d32a2.zip
Merge "Clarify the DBApi object in cells fakes"
-rw-r--r--nova/tests/cells/fakes.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/nova/tests/cells/fakes.py b/nova/tests/cells/fakes.py
index e1f3b6e70..e996cbe13 100644
--- a/nova/tests/cells/fakes.py
+++ b/nova/tests/cells/fakes.py
@@ -22,6 +22,7 @@ from nova.cells import messaging
from nova.cells import state as cells_state
import nova.db
from nova.db import base
+from nova import exception
from nova.openstack.common import cfg
CONF = cfg.CONF
@@ -43,6 +44,10 @@ CELL_NAME_TO_STUB_INFO = {}
class FakeDBApi(object):
+ """Cells uses a different DB in each cell. This means in order to
+ stub out things differently per cell, I need to create a fake DBApi
+ object that is instantiated by each fake cell.
+ """
def __init__(self, cell_db_entries):
self.cell_db_entries = cell_db_entries
@@ -58,8 +63,8 @@ class FakeDBApi(object):
def instance_get_all_by_filters(self, ctxt, *args, **kwargs):
return []
- def instance_get_by_uuid(self, ctxt, *args, **kwargs):
- return None
+ def instance_get_by_uuid(self, ctxt, instance_uuid):
+ raise exception.InstanceNotFound(instance_id=instance_uuid)
class FakeCellsDriver(driver.BaseCellsDriver):