Fix HP3PAR extra-specs scoping prefix bug

The recently added HP 3PAR extra-specs for create share options
use the wrong prefix for scoping. The prefix should not have used
an underscore in it. In addition, the underscore used in the docs
was different than in the code.

The new scoping prefix will be "hpe3par" (to be followed by a colon
for scoping or underscore for future capabilities).

Fixes Bug: #1481106

Change-Id: Ibd326fc367c1845e56706969daf01359fa7b2dac
This commit is contained in:
Mark Sturdevant 2015-08-03 16:30:38 -07:00
parent a9bee6e464
commit eaa2da7cbd
3 changed files with 13 additions and 13 deletions

View File

@ -133,13 +133,13 @@ the share will be created on a backend with a matching share_backend_name.
Scoped extra-specs are used to influence vendor-specific implementation
details. Scoped extra-specs use a prefix followed by a colon. For HP 3PAR
these extra-specs have a prefix of `hp_3par`.
these extra-specs have a prefix of `hpe3par`.
The following HP 3PAR extra-specs are used when creating CIFS (SMB) shares:
- `hp3_par:smb_access_based_enum` = true or false
- `hp3_par:smb_continuous_avail` = true or false
- `hp3_par:smb_cache` = off, manual, optimized or auto
- `hpe3par:smb_access_based_enum` = true or false
- `hpe3par:smb_continuous_avail` = true or false
- `hpe3par:smb_cache` = off, manual, optimized or auto
`smb_access_based_enum` (Access Based Enumeration) specifies if users can see
only the files and directories to which they have been allowed access on the
@ -167,7 +167,7 @@ or earlier.
The following HP 3PAR extra-specs are used when creating NFS shares:
- `hp3_par:nfs_options` = Comma separated list of NFS export options
- `hpe3par:nfs_options` = Comma separated list of NFS export options
The NFS export options have the following limitations:

View File

@ -190,7 +190,7 @@ class HP3ParMediator(object):
def _get_nfs_options(extra_specs, readonly):
"""Validate the NFS extra_specs and return the options to use."""
nfs_options = extra_specs.get('hp_3par:nfs_options')
nfs_options = extra_specs.get('hpe3par:nfs_options')
if nfs_options:
options = nfs_options.split(',')
else:
@ -211,7 +211,7 @@ class HP3ParMediator(object):
]
if invalid_options:
raise exception.InvalidInput(_('Invalid hp3_par:nfs_options in '
raise exception.InvalidInput(_('Invalid hpe3par:nfs_options in '
'extra-specs. The following '
'options are not allowed: %s') %
invalid_options)
@ -241,7 +241,7 @@ class HP3ParMediator(object):
smb_opts = (ACCESS_BASED_ENUM, CONTINUOUS_AVAIL, CACHE)
for smb_opt in smb_opts:
opt_value = extra_specs.get('hp_3par:smb_%s' % smb_opt)
opt_value = extra_specs.get('hpe3par:smb_%s' % smb_opt)
if opt_value:
opt_key = SMB_EXTRA_SPECS_MAP[smb_opt]
createfshare_kwargs[opt_key] = opt_value

View File

@ -220,7 +220,7 @@ class HP3ParMediatorTestCase(test.TestCase):
createfshare_kwargs['clientip'] = '127.0.0.1'
# Options from extra-specs.
opt_string = extra_specs.get('hp_3par:nfs_options', [])
opt_string = extra_specs.get('hpe3par:nfs_options', [])
opt_list = opt_string.split(',')
# Options that the mediator adds.
nfs_options = ['rw', 'no_root_squash', 'insecure']
@ -260,7 +260,7 @@ class HP3ParMediatorTestCase(test.TestCase):
hp3parmediator.CACHE)
for smb_opt in smb_opts:
opt_value = extra_specs.get('hp_3par:smb_%s' % smb_opt)
opt_value = extra_specs.get('hpe3par:smb_%s' % smb_opt)
if opt_value:
opt_key = hp3parmediator.SMB_EXTRA_SPECS_MAP[smb_opt]
createfshare_kwargs[opt_key] = opt_value
@ -289,7 +289,7 @@ class HP3ParMediatorTestCase(test.TestCase):
def _build_smb_extra_specs(**kwargs):
extra_specs = {'driver_handles_share_servers': False}
for k, v in kwargs.items():
extra_specs['hp_3par:smb_%s' % k] = v
extra_specs['hpe3par:smb_%s' % k] = v
return extra_specs
@ddt.data(((3, 2, 1), None, None, None),
@ -353,7 +353,7 @@ class HP3ParMediatorTestCase(test.TestCase):
def test_mediator_create_nfs_share_bad_options(self, nfs_options):
self.init_mediator()
extra_specs = {'hp_3par:nfs_options': nfs_options}
extra_specs = {'hpe3par:nfs_options': nfs_options}
self.assertRaises(exception.InvalidInput,
self.mediator.create_share,
@ -380,7 +380,7 @@ class HP3ParMediatorTestCase(test.TestCase):
self.mock_client.getfsquota.return_value = constants.GET_FSQUOTA
extra_specs = {'hp_3par:nfs_options': nfs_options}
extra_specs = {'hpe3par:nfs_options': nfs_options}
location = self.mediator.create_share(constants.EXPECTED_PROJECT_ID,
constants.EXPECTED_SHARE_ID,