summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorDan Smith <danms@us.ibm.com>2013-06-20 11:34:15 -0700
committerDan Smith <danms@us.ibm.com>2013-06-26 08:03:14 -0700
commit8a393e4c6eaf6921f236dda3e35c16674b9723e2 (patch)
tree960592a81a2ff9ec7c8b8bed30514322a74b5227 /nova
parent851205b8edd2950949e98103d25141c45a744cb1 (diff)
downloadnova-8a393e4c6eaf6921f236dda3e35c16674b9723e2.tar.gz
nova-8a393e4c6eaf6921f236dda3e35c16674b9723e2.tar.xz
nova-8a393e4c6eaf6921f236dda3e35c16674b9723e2.zip
Prepare fake instance stubs for objects
This fixes a couple of calling convention tolerances on fake instance_get methods, as well as makes stub_instance() return a more accurate instance dict. Related to blueprint unified-object-model Change-Id: I9772be52c3f8bbd8cab0ec2dd93821f3e4287b6a
Diffstat (limited to 'nova')
-rw-r--r--nova/tests/api/openstack/fakes.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/tests/api/openstack/fakes.py b/nova/tests/api/openstack/fakes.py
index a4edf9e89..6c30b9a9e 100644
--- a/nova/tests/api/openstack/fakes.py
+++ b/nova/tests/api/openstack/fakes.py
@@ -419,7 +419,7 @@ def get_fake_uuid(token=0):
def fake_instance_get(**kwargs):
- def _return_server(context, uuid):
+ def _return_server(context, uuid, columns_to_join=None):
return stub_instance(1, **kwargs)
return _return_server
@@ -435,6 +435,8 @@ def fake_instance_get_all_by_filters(num_servers=5, **kwargs):
if "limit" in kwargs:
limit = kwargs["limit"]
+ if 'columns_to_join' in kwargs:
+ kwargs.pop('columns_to_join')
for i in xrange(num_servers):
uuid = get_fake_uuid(i)
server = stub_instance(id=i + 1, uuid=uuid,
@@ -504,6 +506,8 @@ def stub_instance(id, user_id=None, project_id=None, host=None,
"id": int(id),
"created_at": datetime.datetime(2010, 10, 10, 12, 0, 0),
"updated_at": datetime.datetime(2010, 11, 11, 11, 0, 0),
+ "deleted_at": datetime.datetime(2010, 12, 12, 10, 0, 0),
+ "deleted": None,
"user_id": user_id,
"project_id": project_id,
"image_ref": image_ref,
@@ -556,6 +560,7 @@ def stub_instance(id, user_id=None, project_id=None, host=None,
"os_type": ""}
instance.update(info_cache)
+ instance['info_cache']['instance_uuid'] = instance['uuid']
return instance