diff options
author | Michael Wilson <geekinutah@gmail.com> | 2013-08-05 14:45:40 -0600 |
---|---|---|
committer | Michael Wilson <geekinutah@gmail.com> | 2013-10-25 09:50:00 -0600 |
commit | 62e9829c19e099e3a10b2b54954163b5e780363b (patch) | |
tree | ed31615df80fd31114816bca0787b7f0c90dc677 /nova/tests/api/openstack/compute/plugins/v3/test_server_metadata.py | |
parent | 6af8c796647d1d1a4fb64bae27e8fa5fce015b0e (diff) | |
download | nova-62e9829c19e099e3a10b2b54954163b5e780363b.tar.gz |
Allow _sync_power_states periodic task to hit slave DB
This commit allows those who have slave_connection configured
to have reads from _sync_power_states hit that connection. This
change does not affect anyone who doesn't have a slave. The
behavior remains the same for them.
Implements: blueprint periodic-tasks-to-db-slave
Change-Id: Iaeb2d47a5064a649f427b18d5cbd2b6b97ce90d0
Diffstat (limited to 'nova/tests/api/openstack/compute/plugins/v3/test_server_metadata.py')
-rw-r--r-- | nova/tests/api/openstack/compute/plugins/v3/test_server_metadata.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nova/tests/api/openstack/compute/plugins/v3/test_server_metadata.py b/nova/tests/api/openstack/compute/plugins/v3/test_server_metadata.py index 170c110bfd..b230341f8c 100644 --- a/nova/tests/api/openstack/compute/plugins/v3/test_server_metadata.py +++ b/nova/tests/api/openstack/compute/plugins/v3/test_server_metadata.py @@ -86,7 +86,8 @@ def return_server(context, server_id, columns_to_join=None): 'vm_state': vm_states.ACTIVE}) -def return_server_by_uuid(context, server_uuid, columns_to_join=None): +def return_server_by_uuid(context, server_uuid, + columns_to_join=None, use_slave=False): return fake_instance.fake_db_instance( **{'id': 1, 'uuid': '0cc3346e-9fef-4445-abe6-5d2b2690ec64', @@ -96,7 +97,8 @@ def return_server_by_uuid(context, server_uuid, columns_to_join=None): 'vm_state': vm_states.ACTIVE}) -def return_server_nonexistent(context, server_id, columns_to_join=None): +def return_server_nonexistent(context, server_id, + columns_to_join=None, use_slave=False): raise exception.InstanceNotFound(instance_id=server_id) @@ -592,7 +594,7 @@ class BadStateServerMetaDataTest(BaseTest): 'vm_state': vm_states.BUILDING}) def _return_server_in_build_by_uuid(self, context, server_uuid, - columns_to_join=None): + columns_to_join=None, use_slave=False): return fake_instance.fake_db_instance( **{'id': 1, 'uuid': '0cc3346e-9fef-4445-abe6-5d2b2690ec64', |