From: Patrick East Date: Fri, 11 Mar 2016 23:28:27 +0000 (-0800) Subject: Fixup stats key for replication in init_host_with_pc X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=178a462c670bbf4a09949065d207519089d484a9;p=openstack-build%2Fcinder-build.git 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 --- diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index ff89cf757..102fcdbf4 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -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."),