From 178a462c670bbf4a09949065d207519089d484a9 Mon Sep 17 00:00:00 2001 From: Patrick East Date: Fri, 11 Mar 2016 15:28:27 -0800 Subject: [PATCH] Fixup stats key for replication in init_host_with_pc MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- cinder/volume/manager.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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."), -- 2.45.2