diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-06-26 20:49:40 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-06-26 20:49:40 +0000 |
| commit | 6c5015d5e1f6f3adfe507624608a6917b58f2dc5 (patch) | |
| tree | 04affc4ef6dd69048f14d1edcd92337eeb99eca9 /nova | |
| parent | ee673d241f8f219d144931e45ac1c25c8b35c424 (diff) | |
| parent | 8a393e4c6eaf6921f236dda3e35c16674b9723e2 (diff) | |
| download | nova-6c5015d5e1f6f3adfe507624608a6917b58f2dc5.tar.gz nova-6c5015d5e1f6f3adfe507624608a6917b58f2dc5.tar.xz nova-6c5015d5e1f6f3adfe507624608a6917b58f2dc5.zip | |
Merge "Prepare fake instance stubs for objects"
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/tests/api/openstack/fakes.py | 7 |
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 |
