Fixup stats key for replication in init_host_with_pc

We were looking for just ‘replication’ in stats, but that key isn’t
used by anyone and would always be false. We instead want to be keying
off of just replication_enabled.

Change-Id: I8f4ef8d5c6594c1548958ebac2ff63b79429cd0b
Closes-Bug: #1556315
This commit is contained in:
Patrick East 2016-03-11 15:28:27 -08:00
parent cc2e463f97
commit 178a462c67
1 changed files with 5 additions and 7 deletions

View File

@ -530,14 +530,12 @@ class VolumeManager(manager.SchedulerDependentManager):
LOG.error(_LE("Service not found for updating "
"replication_status."))
if stats and stats.get('replication', False):
if service.replication_status == (
fields.ReplicationStatus.FAILED_OVER):
pass
elif stats and stats.get('replication_enabled', False):
if service.replication_status != (
fields.ReplicationStatus.FAILED_OVER):
if stats and stats.get('replication_enabled', False):
service.replication_status = fields.ReplicationStatus.ENABLED
else:
service.replication_status = fields.ReplicationStatus.DISABLED
else:
service.replication_status = fields.ReplicationStatus.DISABLED
service.save()
LOG.info(_LI("Driver post RPC initialization completed successfully."),