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
This commit is contained in:
Amrith Kumar 2015-11-16 10:47:31 -05:00
parent 12d27e075f
commit 0c94a5bae0
4 changed files with 10 additions and 10 deletions

View File

@ -349,7 +349,6 @@ instance = {
"required": [],
"additionalProperties": False,
"properties": {
"slave_of": {},
"replica_of": {},
"name": non_empty_string,
"configuration": configuration_id,

View File

@ -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']

View File

@ -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:

View File

@ -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")