From: john-griffith Date: Tue, 31 Dec 2013 16:04:05 +0000 (-0700) Subject: Modify default prefix for solidfire account X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5b74ecbcce2916213086226c36bf935260dfc23f;p=openstack-build%2Fcinder-build.git Modify default prefix for solidfire account The SolidFire driver creates a unique account at volume creation composed of .This is fine until one tries to implement HA Cinder or moves their Cinder node to another machine. This patch changes the default setting to be an empty string (ie no prefix), but still allows backward compatability by setting the config option to 'hostname'. DocImpact: Changes default for account-prefix, for backwards compatability use the non-default 'hostname' Change-Id: I500ea14c1b4e9e3efd51c035cc3c4e6232da9dd6 Closes-Bug: 1265208 --- diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index a0e87d443..3eff78221 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/cinder/volume/drivers/solidfire.py @@ -47,8 +47,10 @@ sf_opts = [ cfg.StrOpt('sf_account_prefix', default=None, - help='Create SolidFire accounts with this prefix. Uses current ' - 'hostname if unset (default).'), + help='Create SolidFire accounts with this prefix. Any string ' + 'can be used here, but the string \"hostname\" is special ' + 'and will create a prefix using the cinder node hostsname ' + '(previous default behavior). The default is NO prefix.'), cfg.IntOpt('sf_api_port', default=443, @@ -224,7 +226,9 @@ class SolidFireDriver(SanISCSIDriver): def _get_sf_account_name(self, project_id): """Build the SolidFire account name to use.""" - prefix = self.configuration.sf_account_prefix or socket.gethostname() + prefix = self.configuration.sf_account_prefix or '' + if prefix == 'hostname': + prefix = socket.gethostname() return '%s%s%s' % (prefix, '-' if prefix else '', project_id) def _get_sfaccount(self, project_id): diff --git a/etc/cinder/cinder.conf.sample b/etc/cinder/cinder.conf.sample index b0cdb7213..36ed10a36 100644 --- a/etc/cinder/cinder.conf.sample +++ b/etc/cinder/cinder.conf.sample @@ -1620,8 +1620,10 @@ # Allow tenants to specify QOS on create (boolean value) #sf_allow_tenant_qos=false -# Create SolidFire accounts with this prefix. Uses current -# hostname if unset (default). (string value) +# Create SolidFire accounts with this prefix. Any string can +# be used here, but the string "hostname" is special and will +# create a prefix using the cinder node hostsname (previous +# default behavior). The default is NO prefix. (string value) #sf_account_prefix= # SolidFire API port. Useful if the device api is behind a