Merge "Fix promote for Redis datastore" into stable/liberty

This commit is contained in:
Jenkins 2015-10-02 13:54:32 +00:00 committed by Gerrit Code Review
commit 1199663529
2 changed files with 5 additions and 2 deletions

View File

@ -122,9 +122,10 @@ class Manager(periodic_task.PeriodicTasks):
persistence_dir = self._app.get_working_dir()
self._perform_restore(backup_info, context, persistence_dir,
self._app)
else:
self._app.restart()
if snapshot:
self.attach_replica(context, snapshot, snapshot['config'])
self._app.restart()
if cluster_config:
self._app.status.set_status(
rd_instance.ServiceStatuses.BUILD_PENDING)

View File

@ -66,6 +66,8 @@ class RedisSyncReplication(base.Replication):
if master_passwd:
connect_options['masterauth'] = master_passwd
service.admin.config_set('masterauth', master_passwd)
else:
service.admin.config_set('masterauth', "")
service.configuration_manager.apply_system_override(
connect_options, change_id=self.CONF_LABEL_REPLICATION_SLAVE)
service.admin.set_master(host=master_host, port=master_port)
@ -75,7 +77,7 @@ class RedisSyncReplication(base.Replication):
service.configuration_manager.remove_system_override(
change_id=self.CONF_LABEL_REPLICATION_SLAVE)
service.admin.set_master(host=None, port=None)
service.admin.config_set('masterauth', None)
service.admin.config_set('masterauth', "")
return None
def cleanup_source_on_replica_detach(self, service, replica_info):