]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
FCZM fix reading of cinder config entries
authorWalter A. Boring IV <walter.boring@hp.com>
Tue, 24 Feb 2015 16:23:03 +0000 (08:23 -0800)
committerWalter A. Boring IV <walter.boring@hp.com>
Tue, 24 Feb 2015 16:33:52 +0000 (08:33 -0800)
The zone manager and the lookup service had some cruft code that
was incorrectly reading the cinder.conf sections it needed.
When cinder.conf was configured to use the Cisco driver, the zone
manager would never see it, because it was reading from the wrong
section of cinder.conf.

Change-Id: I4a48bc39e55d4b7e9a149a3ec3aa3947980360ea
Closes-Bug: 1424852

cinder/zonemanager/fc_san_lookup_service.py
cinder/zonemanager/fc_zone_manager.py
cinder/zonemanager/utils.py

index 99acc84c8863afd543edd59666b5a0642d44f875..f35c8576fa17ee71d4ae98ae67650d3846730463 100644 (file)
@@ -49,8 +49,6 @@ class FCSanLookupService(fc_common.FCCommon):
     def __init__(self, **kwargs):
         super(FCSanLookupService, self).__init__(**kwargs)
 
-        self.configuration = kwargs.get('configuration', None)
-
         opts = fc_zone_manager.zone_manager_opts
         self.configuration = config.Configuration(opts, 'fc-zone-manager')
 
index f508cc519f353194ae81887f7ade73e11b53698a..5108135b8a5b986442a7f1c5243ea685df57d31d 100644 (file)
@@ -88,9 +88,8 @@ class ZoneManager(fc_common.FCCommon):
         """Load the driver from the one specified in args, or from flags."""
         super(ZoneManager, self).__init__(**kwargs)
 
-        self.configuration = kwargs.get('configuration')
-        if self.configuration:
-            self.configuration.append_config_values(zone_manager_opts)
+        self.configuration = config.Configuration(zone_manager_opts,
+                                                  'fc-zone-manager')
 
         self._build_driver()
 
@@ -98,11 +97,10 @@ class ZoneManager(fc_common.FCCommon):
         zone_driver = self.configuration.zone_driver
         LOG.debug("Zone Driver from config: {%s}", zone_driver)
 
-        zm_config = config.Configuration(zone_manager_opts, 'fc-zone-manager')
         # Initialize vendor specific implementation of  FCZoneDriver
         self.driver = importutils.import_object(
             zone_driver,
-            configuration=zm_config)
+            configuration=self.configuration)
 
     def get_zoning_state_ref_count(self, initiator_wwn, target_wwn):
         """Zone management state check.
index fb2dba5257199082df2e98929fb6fb5e1940241d..2268fa10aad67efb7c6a4315a79b9c28b567e32a 100644 (file)
@@ -36,7 +36,7 @@ def create_zone_manager():
     LOG.debug("Zoning mode: %s", config.safe_get('zoning_mode'))
     if config.safe_get('zoning_mode') == 'fabric':
         LOG.debug("FC Zone Manager enabled.")
-        zm = fc_zone_manager.ZoneManager(configuration=config)
+        zm = fc_zone_manager.ZoneManager()
         LOG.info(_LI("Using FC Zone Manager %(zm_version)s,"
                      " Driver %(drv_name)s %(drv_version)s."),
                  {'zm_version': zm.get_version(),
@@ -53,7 +53,7 @@ def create_lookup_service():
     LOG.debug("Zoning mode: %s", config.safe_get('zoning_mode'))
     if config.safe_get('zoning_mode') == 'fabric':
         LOG.debug("FC Lookup Service enabled.")
-        lookup = fc_san_lookup_service.FCSanLookupService(configuration=config)
+        lookup = fc_san_lookup_service.FCSanLookupService()
         LOG.info(_LI("Using FC lookup service %s"), lookup.lookup_service)
         return lookup
     else: