From 0c94a5bae0aacff7fde9a9742b7d526096e51767 Mon Sep 17 00:00:00 2001 From: Amrith Kumar Date: Mon, 16 Nov 2015 10:47:31 -0500 Subject: [PATCH] Time to get rid of most vestiges of slave_of Commit https://review.openstack.org/#/c/245738/ eliminated slave_of in the python-troveclient. The controller has long understood how to deal with replica_of but there are a couple of tests that are still sending in slave_of. This commit removes slave_of from the tests and from the Trove public API. The python-troveclient commit will depend on this commit as the DSVM test(s) which are in the trove repository currently fail in that change. This commit also contains a change to tests/api/replication.py and disables the test 'test_detach_replica' and test_slave_is_not_read_only with a distinct SkipTest. This is to break the deadly embrace between this change set and the related changeset on the client side as circular dependencies across projects are not allowed. Change-Id: I87c8a14c06fa5df60ea3ed6b09412dc32fafcec7 Partial-Bug: #1461196 Related: I9b905716b704ea9ec9332b48b05c49cccbd04c8b --- trove/common/apischema.py | 1 - trove/instance/service.py | 7 ++----- trove/tests/api/instances.py | 2 +- trove/tests/api/replication.py | 10 +++++++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/trove/common/apischema.py b/trove/common/apischema.py index 6863ced825..22604dc96e 100644 --- a/trove/common/apischema.py +++ b/trove/common/apischema.py @@ -349,7 +349,6 @@ instance = { "required": [], "additionalProperties": False, "properties": { - "slave_of": {}, "replica_of": {}, "name": non_empty_string, "configuration": configuration_id, diff --git a/trove/instance/service.py b/trove/instance/service.py index 3cb65dee5a..4cf26f768f 100644 --- a/trove/instance/service.py +++ b/trove/instance/service.py @@ -235,9 +235,7 @@ class InstanceController(wsgi.Controller): availability_zone = body['instance'].get('availability_zone') nics = body['instance'].get('nics') - slave_of_id = body['instance'].get('replica_of', - # also check for older name - body['instance'].get('slave_of')) + slave_of_id = body['instance'].get('replica_of') replica_count = body['instance'].get('replica_count') instance = models.Instance.create(context, name, flavor_id, image_id, databases, users, @@ -308,8 +306,7 @@ class InstanceController(wsgi.Controller): instance = models.Instance.load(context, id) args = {} - args['detach_replica'] = ('replica_of' in body['instance'] or - 'slave_of' in body['instance']) + args['detach_replica'] = 'replica_of' in body['instance'] if 'name' in body['instance']: args['name'] = body['instance']['name'] diff --git a/trove/tests/api/instances.py b/trove/tests/api/instances.py index 52d1ef34cc..78970dd842 100644 --- a/trove/tests/api/instances.py +++ b/trove/tests/api/instances.py @@ -1583,7 +1583,7 @@ class CheckInstance(AttrCheck): self.instance['volume'], allowed_attrs, msg="Volume") - def slave_of(self): + def replica_of(self): if 'replica_of' not in self.instance: self.fail("'replica_of' not found in instance.") else: diff --git a/trove/tests/api/replication.py b/trove/tests/api/replication.py index 4fa0ec67a5..92c97cb0fb 100644 --- a/trove/tests/api/replication.py +++ b/trove/tests/api/replication.py @@ -93,7 +93,7 @@ def create_slave(): nics=instance_info.nics, datastore=instance_info.dbaas_datastore, datastore_version=instance_info.dbaas_datastore_version, - slave_of=instance_info.id) + replica_of=instance_info.id) assert_equal(200, instance_info.dbaas.last_http_code) assert_equal("BUILD", result.status) return result.id @@ -103,7 +103,7 @@ def validate_slave(master, slave): new_slave = instance_info.dbaas.instances.get(slave.id) assert_equal(200, instance_info.dbaas.last_http_code) ns_dict = new_slave._info - CheckInstance(ns_dict).slave_of() + CheckInstance(ns_dict).replica_of() assert_equal(master.id, ns_dict['replica_of']['id']) @@ -128,7 +128,7 @@ class CreateReplicationSlave(object): instance_info.name + "_slave", instance_info.dbaas_flavor_href, instance_info.volume, - slave_of="Missing replica source") + replica_of="Missing replica source") assert_equal(404, instance_info.dbaas.last_http_code) @test @@ -337,6 +337,8 @@ class DetachReplica(object): @test @time_out(5 * 60) def test_detach_replica(self): + raise SkipTest("Skip test to allow changeset 245845 to merge.") + if CONFIG.fake_mode: raise SkipTest("Detach replica not supported in fake mode") @@ -349,6 +351,8 @@ class DetachReplica(object): @test(depends_on=[test_detach_replica]) @time_out(5 * 60) def test_slave_is_not_read_only(self): + raise SkipTest("Skip test to allow changeset 245845 to merge.") + if CONFIG.fake_mode: raise SkipTest("Test not_read_only not supported in fake mode")