From: Dirk Mueller <dirk@dmllr.de>
Date: Wed, 15 Jan 2014 17:23:40 +0000 (+0100)
Subject: Register EMC config options globally
X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e4505f8a617e7c9544bb142478d182ec9d37bdf9;p=openstack-build%2Fcinder-build.git

Register EMC config options globally

The registration allows the oslo sample config generator
to detect the config options and extract automatically
a config template.

Change-Id: Ib181d734dddbd9b6a664439286969b832d6536e7
---

diff --git a/cinder/volume/drivers/emc/emc_smis_common.py b/cinder/volume/drivers/emc/emc_smis_common.py
index 2a0de7528..f5aefeb7b 100644
--- a/cinder/volume/drivers/emc/emc_smis_common.py
+++ b/cinder/volume/drivers/emc/emc_smis_common.py
@@ -42,6 +42,15 @@ except ImportError:
 
 CINDER_EMC_CONFIG_FILE = '/etc/cinder/cinder_emc_config.xml'
 
+emc_opts = [
+    cfg.StrOpt('cinder_emc_config_file',
+               default=CINDER_EMC_CONFIG_FILE,
+               help='use this file for cinder emc plugin '
+                    'config data'), ]
+
+
+CONF.register_opts(emc_opts)
+
 
 class EMCSMISCommon():
     """Common code that can be used by ISCSI and FC drivers."""
@@ -55,15 +64,9 @@ class EMCSMISCommon():
              'volume_backend_name': None}
 
     def __init__(self, prtcl, configuration=None):
-
-        opt = cfg.StrOpt('cinder_emc_config_file',
-                         default=CINDER_EMC_CONFIG_FILE,
-                         help='use this file for cinder emc plugin '
-                         'config data')
-        CONF.register_opt(opt)
         self.protocol = prtcl
         self.configuration = configuration
-        self.configuration.append_config_values([opt])
+        self.configuration.append_config_values(emc_opts)
 
         ip, port = self._get_ecom_server()
         self.user, self.passwd = self._get_ecom_cred()
diff --git a/etc/cinder/cinder.conf.sample b/etc/cinder/cinder.conf.sample
index 3caf3eeac..f50d1dd31 100644
--- a/etc/cinder/cinder.conf.sample
+++ b/etc/cinder/cinder.conf.sample
@@ -1056,6 +1056,15 @@
 #coraid_repository_key=coraid_repository
 
 
+#
+# Options defined in cinder.volume.drivers.emc.emc_smis_common
+#
+
+# use this file for cinder emc plugin config data (string
+# value)
+#cinder_emc_config_file=/etc/cinder/cinder_emc_config.xml
+
+
 #
 # Options defined in cinder.volume.drivers.eqlx
 #