diff --git a/lib/rome/core/session/fake_session.py b/lib/rome/core/session/fake_session.py index 4070717..0fdc3c1 100644 --- a/lib/rome/core/session/fake_session.py +++ b/lib/rome/core/session/fake_session.py @@ -27,8 +27,8 @@ def flush(self, *args, **kwargs): # -# def get_session(use_slave=False, **kwargs): -# # facade = _create_facade_lazily(use_slave) +# def get_session(use_subordinate=False, **kwargs): +# # facade = _create_facade_lazily(use_subordinate) # # return facade.get_session(**kwargs) # # return FakeSession() diff --git a/lib/rome/utils/MemoizationDecorator.py b/lib/rome/utils/MemoizationDecorator.py index 2915de9..70a94e0 100755 --- a/lib/rome/utils/MemoizationDecorator.py +++ b/lib/rome/utils/MemoizationDecorator.py @@ -47,7 +47,7 @@ def __call__(self, *args, **kwargs): should_retry = False item["modification_lock"].release() if should_retry: - # memory has been destroyed by a master call, simply abort it and repeat the method. + # memory has been destroyed by a main call, simply abort it and repeat the method. return self.__call__(*args, **kwargs) # Wait for the expected value. result = item["result_queue"].get() @@ -67,7 +67,7 @@ def __call__(self, *args, **kwargs): self.insertion_lock.release() if should_retry: - # memory has been initialised by a quicker concurrent call, simply abort it and become a slave. + # memory has been initialised by a quicker concurrent call, simply abort it and become a subordinate. return self.__call__(*args, **kwargs) # compute the expected value and store it in a shared memory. @@ -85,11 +85,11 @@ def __call__(self, *args, **kwargs): # delete the memory item item = self.memory[call_hash] - # send to concurrent slave calls. + # send to concurrent subordinate calls. for i in range(item["waiting_threads_count"]): item["result_queue"].put(result) - # Once there are no more slave calls, the item can be destroyed + # Once there are no more subordinate calls, the item can be destroyed item["modification_lock"].acquire() self.insertion_lock.acquire() del self.memory[call_hash] diff --git a/test/glance/api.py b/test/glance/api.py index 6826015..7e9a9ef 100644 --- a/test/glance/api.py +++ b/test/glance/api.py @@ -110,7 +110,7 @@ def get_engine(): # return facade.get_session(autocommit=autocommit, # expire_on_commit=expire_on_commit) -def get_session(use_slave = False, **kwargs): +def get_session(use_subordinate = False, **kwargs): return RomeSession() def clear_db_env(): diff --git a/test/glance/test_image_get_all.py b/test/glance/test_image_get_all.py index f7623c3..67d06b2 100644 --- a/test/glance/test_image_get_all.py +++ b/test/glance/test_image_get_all.py @@ -34,7 +34,7 @@ def _drop_protected_attrs(model_class, values): if attr in values: del values[attr] -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/glance/test_image_update.py b/test/glance/test_image_update.py index 46710e6..bc0ce56 100644 --- a/test/glance/test_image_update.py +++ b/test/glance/test_image_update.py @@ -42,7 +42,7 @@ def _drop_protected_attrs(model_class, values): if attr in values: del values[attr] -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/features/test_convert_datetime.py b/test/nova/features/test_convert_datetime.py index 2800b42..5620a27 100644 --- a/test/nova/features/test_convert_datetime.py +++ b/test/nova/features/test_convert_datetime.py @@ -12,7 +12,7 @@ import datetime import pytz -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test__action_get_by_request_id.py b/test/nova/methods/test__action_get_by_request_id.py index 90b84e5..6de0123 100644 --- a/test/nova/methods/test__action_get_by_request_id.py +++ b/test/nova/methods/test__action_get_by_request_id.py @@ -31,7 +31,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test__instance_data_get_for_user.py b/test/nova/methods/test__instance_data_get_for_user.py index de1a47c..1609066 100755 --- a/test/nova/methods/test__instance_data_get_for_user.py +++ b/test/nova/methods/test__instance_data_get_for_user.py @@ -36,7 +36,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_aggregate_get_by_metadata_key.py b/test/nova/methods/test_aggregate_get_by_metadata_key.py index 1ca798c..e2c0bc2 100644 --- a/test/nova/methods/test_aggregate_get_by_metadata_key.py +++ b/test/nova/methods/test_aggregate_get_by_metadata_key.py @@ -25,7 +25,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_aggregate_metadata_get_by_metadata_key.py b/test/nova/methods/test_aggregate_metadata_get_by_metadata_key.py index 71bf0cc..36268db 100644 --- a/test/nova/methods/test_aggregate_metadata_get_by_metadata_key.py +++ b/test/nova/methods/test_aggregate_metadata_get_by_metadata_key.py @@ -27,7 +27,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_block_device_mapping_get_all_by_instance.py b/test/nova/methods/test_block_device_mapping_get_all_by_instance.py index 041f7c0..d8ecebf 100644 --- a/test/nova/methods/test_block_device_mapping_get_all_by_instance.py +++ b/test/nova/methods/test_block_device_mapping_get_all_by_instance.py @@ -32,7 +32,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() @@ -44,12 +44,12 @@ def model_query(context, *args, **kwargs): return RomeQuery(*args, **kwargs) def _block_device_mapping_get_query(context, session=None, - columns_to_join=None, use_slave=False): + columns_to_join=None, use_subordinate=False): if columns_to_join is None: columns_to_join = [] query = model_query(context, models.BlockDeviceMapping, - session=session, use_slave=use_slave) + session=session, use_subordinate=use_subordinate) for column in columns_to_join: query = query.options(joinedload(column)) @@ -58,8 +58,8 @@ def _block_device_mapping_get_query(context, session=None, def block_device_mapping_get_all_by_instance(context, instance_uuid, - use_slave=False): - return _block_device_mapping_get_query(context, use_slave=use_slave).\ + use_subordinate=False): + return _block_device_mapping_get_query(context, use_subordinate=use_subordinate).\ filter_by(instance_uuid=instance_uuid).\ all() diff --git a/test/nova/methods/test_block_device_mapping_update_or_create.py b/test/nova/methods/test_block_device_mapping_update_or_create.py index 4001f01..0795f0d 100644 --- a/test/nova/methods/test_block_device_mapping_update_or_create.py +++ b/test/nova/methods/test_block_device_mapping_update_or_create.py @@ -32,7 +32,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_compute_node_get_all.py b/test/nova/methods/test_compute_node_get_all.py index c0fffaa..0367288 100755 --- a/test/nova/methods/test_compute_node_get_all.py +++ b/test/nova/methods/test_compute_node_get_all.py @@ -24,7 +24,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_conductor_service_update.py b/test/nova/methods/test_conductor_service_update.py index 6607f19..fad3252 100755 --- a/test/nova/methods/test_conductor_service_update.py +++ b/test/nova/methods/test_conductor_service_update.py @@ -27,7 +27,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() @@ -39,9 +39,9 @@ def model_query(context, *args, **kwargs): return RomeQuery(*args, **kwargs) def _service_get(context, service_id, with_compute_node=True, session=None, - use_slave=False): + use_subordinate=False): query = model_query(context, models.Service, session=session, - use_slave=use_slave).\ + use_subordinate=use_subordinate).\ filter_by(id=service_id) # if with_compute_node: diff --git a/test/nova/methods/test_ensure_default_secgroup.py b/test/nova/methods/test_ensure_default_secgroup.py index b9ca4c3..2cb5e23 100755 --- a/test/nova/methods/test_ensure_default_secgroup.py +++ b/test/nova/methods/test_ensure_default_secgroup.py @@ -8,7 +8,7 @@ import logging -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_extract_flavor.py b/test/nova/methods/test_extract_flavor.py index 9f9c39b..911859b 100755 --- a/test/nova/methods/test_extract_flavor.py +++ b/test/nova/methods/test_extract_flavor.py @@ -22,7 +22,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_fixed_ip_associate_pool.py b/test/nova/methods/test_fixed_ip_associate_pool.py index 802de30..1ce390c 100644 --- a/test/nova/methods/test_fixed_ip_associate_pool.py +++ b/test/nova/methods/test_fixed_ip_associate_pool.py @@ -32,7 +32,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_fixed_ip_from_db_object.py b/test/nova/methods/test_fixed_ip_from_db_object.py index eadde03..7a0f61d 100755 --- a/test/nova/methods/test_fixed_ip_from_db_object.py +++ b/test/nova/methods/test_fixed_ip_from_db_object.py @@ -34,7 +34,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_fixed_ip_get_by_host.py b/test/nova/methods/test_fixed_ip_get_by_host.py index 46d6a3b..cce6aa8 100644 --- a/test/nova/methods/test_fixed_ip_get_by_host.py +++ b/test/nova/methods/test_fixed_ip_get_by_host.py @@ -32,7 +32,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_fixed_ip_get_by_instance.py b/test/nova/methods/test_fixed_ip_get_by_instance.py index 36e3512..a4db350 100755 --- a/test/nova/methods/test_fixed_ip_get_by_instance.py +++ b/test/nova/methods/test_fixed_ip_get_by_instance.py @@ -32,7 +32,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_fixed_ip_get_by_instance_uuid.py b/test/nova/methods/test_fixed_ip_get_by_instance_uuid.py index 1efcffb..0269e2f 100755 --- a/test/nova/methods/test_fixed_ip_get_by_instance_uuid.py +++ b/test/nova/methods/test_fixed_ip_get_by_instance_uuid.py @@ -35,7 +35,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_fixed_ip_get_by_network.py b/test/nova/methods/test_fixed_ip_get_by_network.py index 2261bcf..a0c428a 100644 --- a/test/nova/methods/test_fixed_ip_get_by_network.py +++ b/test/nova/methods/test_fixed_ip_get_by_network.py @@ -38,7 +38,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_flavor_get_all.py b/test/nova/methods/test_flavor_get_all.py index cf57cf3..fc1be31 100755 --- a/test/nova/methods/test_flavor_get_all.py +++ b/test/nova/methods/test_flavor_get_all.py @@ -31,7 +31,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_flavor_get_by_flavor_id.py b/test/nova/methods/test_flavor_get_by_flavor_id.py index 5120a18..2d7075f 100755 --- a/test/nova/methods/test_flavor_get_by_flavor_id.py +++ b/test/nova/methods/test_flavor_get_by_flavor_id.py @@ -31,7 +31,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_get_by_network.py b/test/nova/methods/test_get_by_network.py index 569eeb3..ab1ad3d 100755 --- a/test/nova/methods/test_get_by_network.py +++ b/test/nova/methods/test_get_by_network.py @@ -34,7 +34,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_instance_create.py b/test/nova/methods/test_instance_create.py index 5df688a..eb3b244 100755 --- a/test/nova/methods/test_instance_create.py +++ b/test/nova/methods/test_instance_create.py @@ -28,7 +28,7 @@ _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_instance_faults_get_by_instance_uuids.py b/test/nova/methods/test_instance_faults_get_by_instance_uuids.py index c5fd58b..ade9804 100644 --- a/test/nova/methods/test_instance_faults_get_by_instance_uuids.py +++ b/test/nova/methods/test_instance_faults_get_by_instance_uuids.py @@ -28,7 +28,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_instance_get_active_by_window_joined.py b/test/nova/methods/test_instance_get_active_by_window_joined.py index bc8b752..6084dd8 100755 --- a/test/nova/methods/test_instance_get_active_by_window_joined.py +++ b/test/nova/methods/test_instance_get_active_by_window_joined.py @@ -36,7 +36,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() @@ -53,14 +53,14 @@ def _network_get_query(context, session=None): read_deleted="no") def _instance_get_all_query(context, project_only=False, - joins=None, use_slave=False): + joins=None, use_subordinate=False): if joins is None: joins = ['info_cache', 'security_groups'] query = model_query(context, models.Instance, project_only=project_only, - use_slave=use_slave) + use_subordinate=use_subordinate) # for join in joins: # query = query.options(joinedload(join)) return query @@ -71,7 +71,7 @@ def _instance_pcidevs_get_multi(context, instance_uuids, session=None): filter(models.PciDevice.instance_uuid.in_(instance_uuids)) def _instances_fill_metadata(context, instances, - manual_joins=None, use_slave=False): + manual_joins=None, use_subordinate=False): """Selectively fill instances with manually-joined metadata. Note that instance will be converted to a dict. :param context: security context @@ -128,9 +128,9 @@ def _manual_join_columns(columns_to_join): def instance_get_active_by_window_joined(context, begin, end=None, project_id=None, host=None, - use_slave=False): + use_subordinate=False): """Return instances and joins that were active during window.""" - session = get_session(use_slave=use_slave) + session = get_session(use_subordinate=use_subordinate) query = session.query(models.Instance) query = query.options(joinedload('info_cache')).\ diff --git a/test/nova/methods/test_instance_get_all.py b/test/nova/methods/test_instance_get_all.py index d92c0ee..60ff3f8 100644 --- a/test/nova/methods/test_instance_get_all.py +++ b/test/nova/methods/test_instance_get_all.py @@ -32,7 +32,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() @@ -55,7 +55,7 @@ def _manual_join_columns(columns_to_join): def instance_get_all_by_filters(context, filters, sort_key, sort_dir, limit=None, marker=None, columns_to_join=None, - use_slave=False): + use_subordinate=False): """Return instances that match all filters. Deleted instances will be returned by default, unless there's a filter that says otherwise. @@ -89,10 +89,10 @@ def instance_get_all_by_filters(context, filters, sort_key, sort_dir, sort_fn = {'desc': desc, 'asc': asc} - # if CONF.database.slave_connection == '': - # use_slave = False + # if CONF.database.subordinate_connection == '': + # use_subordinate = False - session = get_session(use_slave=use_slave) + session = get_session(use_subordinate=use_subordinate) if columns_to_join is None: columns_to_join = ['info_cache', 'security_groups'] diff --git a/test/nova/methods/test_instance_get_all_by_filters.py b/test/nova/methods/test_instance_get_all_by_filters.py index 662cd72..9514879 100755 --- a/test/nova/methods/test_instance_get_all_by_filters.py +++ b/test/nova/methods/test_instance_get_all_by_filters.py @@ -35,7 +35,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() @@ -52,14 +52,14 @@ def _network_get_query(context, session=None): read_deleted="no") def _instance_get_all_query(context, project_only=False, - joins=None, use_slave=False): + joins=None, use_subordinate=False): if joins is None: joins = ['info_cache', 'security_groups'] query = model_query(context, models.Instance, project_only=project_only, - use_slave=use_slave) + use_subordinate=use_subordinate) # for join in joins: # query = query.options(joinedload(join)) return query @@ -70,7 +70,7 @@ def _instance_pcidevs_get_multi(context, instance_uuids, session=None): filter(models.PciDevice.instance_uuid.in_(instance_uuids)) def _instances_fill_metadata(context, instances, - manual_joins=None, use_slave=False): + manual_joins=None, use_subordinate=False): """Selectively fill instances with manually-joined metadata. Note that instance will be converted to a dict. :param context: security context @@ -126,7 +126,7 @@ def _manual_join_columns(columns_to_join): def instance_get_all_by_filters(context, filters, sort_key, sort_dir, limit=None, marker=None, columns_to_join=None, - use_slave=False): + use_subordinate=False): """Return instances that match all filters. Deleted instances will be returned by default, unless there's a filter that says otherwise. @@ -168,10 +168,10 @@ def instance_get_all_by_filters(context, filters, sort_key, sort_dir, sort_fn = {'desc': desc, 'asc': asc} - # if CONF.database.slave_connection == '': - # use_slave = False + # if CONF.database.subordinate_connection == '': + # use_subordinate = False - session = get_session(use_slave=use_slave) + session = get_session(use_subordinate=use_subordinate) if columns_to_join is None: columns_to_join = ['info_cache', 'security_groups'] diff --git a/test/nova/methods/test_instance_get_all_by_host.py b/test/nova/methods/test_instance_get_all_by_host.py index 1bfc75b..895689a 100755 --- a/test/nova/methods/test_instance_get_all_by_host.py +++ b/test/nova/methods/test_instance_get_all_by_host.py @@ -31,7 +31,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() @@ -48,14 +48,14 @@ def _network_get_query(context, session=None): read_deleted="no") def _instance_get_all_query(context, project_only=False, - joins=None, use_slave=False): + joins=None, use_subordinate=False): if joins is None: joins = ['info_cache', 'security_groups'] query = model_query(context, models.Instance, project_only=project_only, - use_slave=use_slave) + use_subordinate=use_subordinate) # for join in joins: # query = query.options(joinedload(join)) return query @@ -66,7 +66,7 @@ def _instance_pcidevs_get_multi(context, instance_uuids, session=None): filter(models.PciDevice.instance_uuid.in_(instance_uuids)) def _instances_fill_metadata(context, instances, - manual_joins=None, use_slave=False): + manual_joins=None, use_subordinate=False): """Selectively fill instances with manually-joined metadata. Note that instance will be converted to a dict. :param context: security context @@ -114,9 +114,9 @@ def flatten(l): def instance_get_all_by_host(context, host, columns_to_join=None, - use_slave=False): + use_subordinate=False): instances = _instance_get_all_query(context, - use_slave=use_slave).filter_by(host=host).all() + use_subordinate=use_subordinate).filter_by(host=host).all() return _instances_fill_metadata(context, instances, ["system_metadata"]) diff --git a/test/nova/methods/test_instance_get_from_db.py b/test/nova/methods/test_instance_get_from_db.py index 91ab0b6..080d3bc 100755 --- a/test/nova/methods/test_instance_get_from_db.py +++ b/test/nova/methods/test_instance_get_from_db.py @@ -22,7 +22,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_migration_get_in_progress_by_host_and_node.py b/test/nova/methods/test_migration_get_in_progress_by_host_and_node.py index f96db54..ca16920 100755 --- a/test/nova/methods/test_migration_get_in_progress_by_host_and_node.py +++ b/test/nova/methods/test_migration_get_in_progress_by_host_and_node.py @@ -30,7 +30,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_network_get_all_by_host.py b/test/nova/methods/test_network_get_all_by_host.py index 517a37b..400f3da 100755 --- a/test/nova/methods/test_network_get_all_by_host.py +++ b/test/nova/methods/test_network_get_all_by_host.py @@ -30,7 +30,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_network_get_associated_fixed_ips.py b/test/nova/methods/test_network_get_associated_fixed_ips.py index d39cae9..7134db4 100755 --- a/test/nova/methods/test_network_get_associated_fixed_ips.py +++ b/test/nova/methods/test_network_get_associated_fixed_ips.py @@ -29,7 +29,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_quota_get_all_by_project.py b/test/nova/methods/test_quota_get_all_by_project.py index a596c9e..09bcba7 100755 --- a/test/nova/methods/test_quota_get_all_by_project.py +++ b/test/nova/methods/test_quota_get_all_by_project.py @@ -31,7 +31,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() @@ -48,14 +48,14 @@ def _network_get_query(context, session=None): read_deleted="no") def _instance_get_all_query(context, project_only=False, - joins=None, use_slave=False): + joins=None, use_subordinate=False): if joins is None: joins = ['info_cache', 'security_groups'] query = model_query(context, models.Instance, project_only=project_only, - use_slave=use_slave) + use_subordinate=use_subordinate) # for join in joins: # query = query.options(joinedload(join)) return query @@ -66,7 +66,7 @@ def _instance_pcidevs_get_multi(context, instance_uuids, session=None): filter(models.PciDevice.instance_uuid.in_(instance_uuids)) def _instances_fill_metadata(context, instances, - manual_joins=None, use_slave=False): + manual_joins=None, use_subordinate=False): """Selectively fill instances with manually-joined metadata. Note that instance will be converted to a dict. :param context: security context diff --git a/test/nova/methods/test_quota_usage_get_all_by_project.py b/test/nova/methods/test_quota_usage_get_all_by_project.py index a9cec41..35198da 100755 --- a/test/nova/methods/test_quota_usage_get_all_by_project.py +++ b/test/nova/methods/test_quota_usage_get_all_by_project.py @@ -31,7 +31,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() @@ -48,14 +48,14 @@ def _network_get_query(context, session=None): read_deleted="no") def _instance_get_all_query(context, project_only=False, - joins=None, use_slave=False): + joins=None, use_subordinate=False): if joins is None: joins = ['info_cache', 'security_groups'] query = model_query(context, models.Instance, project_only=project_only, - use_slave=use_slave) + use_subordinate=use_subordinate) # for join in joins: # query = query.options(joinedload(join)) return query @@ -66,7 +66,7 @@ def _instance_pcidevs_get_multi(context, instance_uuids, session=None): filter(models.PciDevice.instance_uuid.in_(instance_uuids)) def _instances_fill_metadata(context, instances, - manual_joins=None, use_slave=False): + manual_joins=None, use_subordinate=False): """Selectively fill instances with manually-joined metadata. Note that instance will be converted to a dict. :param context: security context diff --git a/test/nova/methods/test_reservation_commit.py b/test/nova/methods/test_reservation_commit.py index 5c02208..d87eb08 100755 --- a/test/nova/methods/test_reservation_commit.py +++ b/test/nova/methods/test_reservation_commit.py @@ -35,7 +35,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_reservation_expire.py b/test/nova/methods/test_reservation_expire.py index e16b7be..57cd299 100755 --- a/test/nova/methods/test_reservation_expire.py +++ b/test/nova/methods/test_reservation_expire.py @@ -35,7 +35,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession() diff --git a/test/nova/methods/test_service_get_all_by_compute_host.py b/test/nova/methods/test_service_get_all_by_compute_host.py index d1bece4..c4acf63 100755 --- a/test/nova/methods/test_service_get_all_by_compute_host.py +++ b/test/nova/methods/test_service_get_all_by_compute_host.py @@ -30,7 +30,7 @@ INSTANCE_OPTIONAL_ATTRS = (_INSTANCE_OPTIONAL_JOINED_FIELDS + _INSTANCE_OPTIONAL_NON_COLUMN_FIELDS) -def get_session(use_slave=False, **kwargs): +def get_session(use_subordinate=False, **kwargs): # return FakeSession() return RomeSession() # return OldRomeSession()