From 280cb0314958bb7d8e58954a17bbef675d76e3fc Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Tue, 10 Jun 2014 13:40:36 -0700 Subject: [PATCH] Fix Brocade FC driver's use of the fc_fabric_names The Brocade Fibre Channel Zone Manager driver wasn't stripping out whitespace in the fc_fabric_names prior to using them. This would cause breakage later on in the driver. Change-Id: I6d16a35026fdd2f30a92f9dff16435a6c39b699a Closes-Bug: 1328681 --- .../drivers/brocade/brcd_fc_san_lookup_service.py | 4 ++-- cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py b/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py index d1f762e18..3947a56e0 100644 --- a/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py +++ b/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py @@ -51,7 +51,7 @@ class BrcdFCSanLookupService(FCSanLookupService): """Configuration specific to SAN context values.""" config = self.configuration - fabric_names = config.fc_fabric_names.split(',') + fabric_names = [x.strip() for x in config.fc_fabric_names.split(',')] LOG.debug(_('Fabric Names: %s'), fabric_names) # There can be more than one SAN in the network and we need to @@ -105,7 +105,7 @@ class BrcdFCSanLookupService(FCSanLookupService): err=_("Missing Fibre Channel SAN configuration " "param - fc_fabric_names")) - fabrics = fabric_names.split(',') + fabrics = [x.strip() for x in fabric_names.split(',')] LOG.debug(_("FC Fabric List: %s"), fabrics) if fabrics: for t in target_wwn_list: diff --git a/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py b/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py index da1802186..ab0f8ce12 100644 --- a/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py +++ b/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py @@ -98,7 +98,9 @@ class BrcdFCZoneDriver(FCZoneDriver): if len(base_san_opts) > 0: CONF.register_opts(base_san_opts) self.configuration.append_config_values(base_san_opts) - fabric_names = self.configuration.fc_fabric_names.split(',') + + fc_fabric_names = self.configuration.fc_fabric_names + fabric_names = [x.strip() for x in fc_fabric_names.split(',')] # There can be more than one SAN in the network and we need to # get credentials for each SAN. @@ -373,7 +375,8 @@ class BrcdFCZoneDriver(FCZoneDriver): # TODO(Santhosh Kolathur): consider refactoring to use lookup service. formatted_target_list = [] fabric_map = {} - fabrics = self.configuration.fc_fabric_names.split(',') + fc_fabric_names = self.configuration.fc_fabric_names + fabrics = [x.strip() for x in fc_fabric_names.split(',')] LOG.debug(_("Fabric List: %s"), fabrics) LOG.debug(_("Target wwn List: %s"), target_wwn_list) if len(fabrics) > 0: -- 2.45.2