From e4505f8a617e7c9544bb142478d182ec9d37bdf9 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 15 Jan 2014 18:23:40 +0100 Subject: [PATCH] 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 --- cinder/volume/drivers/emc/emc_smis_common.py | 17 ++++++++++------- etc/cinder/cinder.conf.sample | 9 +++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) 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 # -- 2.45.2