HP 3PAR extra-spec prefix needs to be hp3par

The HP 3PAR share type extra-spec prefix needs
to be "hp3par". The decision to go with "hpe"
was premature and has been reversed. It needs
to be "hp3par" to be in sync with Cinder.

Change-Id: I616832c71d1797fc00da0d9e42c35c315381b6d9
Depends-On: I26dd32b1de8cceeaa6dc674092efec683df71889
Closes-bug: #1488662
This commit is contained in:
Mark Sturdevant 2015-09-01 09:27:16 -07:00
parent 51178fce72
commit 4b12f9c8e7
3 changed files with 15 additions and 14 deletions

View File

@ -156,13 +156,13 @@ technology.
Scoped extra-specs are used to influence vendor-specific implementation Scoped extra-specs are used to influence vendor-specific implementation
details. Scoped extra-specs use a prefix followed by a colon. For HP 3PAR details. Scoped extra-specs use a prefix followed by a colon. For HP 3PAR
these extra-specs have a prefix of `hpe3par`. these extra-specs have a prefix of `hp3par`.
The following HP 3PAR extra-specs are used when creating CIFS (SMB) shares: The following HP 3PAR extra-specs are used when creating CIFS (SMB) shares:
- `hpe3par:smb_access_based_enum` = true or false - `hp3par:smb_access_based_enum` = true or false
- `hpe3par:smb_continuous_avail` = true or false - `hp3par:smb_continuous_avail` = true or false
- `hpe3par:smb_cache` = off, manual, optimized or auto - `hp3par:smb_cache` = off, manual, optimized or auto
`smb_access_based_enum` (Access Based Enumeration) specifies if users can see `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 only the files and directories to which they have been allowed access on the
@ -190,7 +190,7 @@ or earlier.
The following HP 3PAR extra-specs are used when creating NFS shares: The following HP 3PAR extra-specs are used when creating NFS shares:
- `hpe3par:nfs_options` = Comma separated list of NFS export options - `hp3par:nfs_options` = Comma separated list of NFS export options
The NFS export options have the following limitations: The NFS export options have the following limitations:

View File

@ -59,10 +59,11 @@ class HP3ParMediator(object):
1.0.00 - Begin Liberty development (post-Kilo) 1.0.00 - Begin Liberty development (post-Kilo)
1.0.01 - Report thin/dedup/hp_flash_cache capabilities 1.0.01 - Report thin/dedup/hp_flash_cache capabilities
1.0.02 - Add share server/share network support 1.0.02 - Add share server/share network support
1.0.03 - Use hp3par prefix for share types and capabilities
""" """
VERSION = "1.0.02" VERSION = "1.0.03"
def __init__(self, **kwargs): def __init__(self, **kwargs):
@ -282,7 +283,7 @@ class HP3ParMediator(object):
def _get_nfs_options(extra_specs, readonly): def _get_nfs_options(extra_specs, readonly):
"""Validate the NFS extra_specs and return the options to use.""" """Validate the NFS extra_specs and return the options to use."""
nfs_options = extra_specs.get('hpe3par:nfs_options') nfs_options = extra_specs.get('hp3par:nfs_options')
if nfs_options: if nfs_options:
options = nfs_options.split(',') options = nfs_options.split(',')
else: else:
@ -303,7 +304,7 @@ class HP3ParMediator(object):
] ]
if invalid_options: if invalid_options:
raise exception.InvalidInput(_('Invalid hpe3par:nfs_options in ' raise exception.InvalidInput(_('Invalid hp3par:nfs_options in '
'extra-specs. The following ' 'extra-specs. The following '
'options are not allowed: %s') % 'options are not allowed: %s') %
invalid_options) invalid_options)
@ -333,7 +334,7 @@ class HP3ParMediator(object):
smb_opts = (ACCESS_BASED_ENUM, CONTINUOUS_AVAIL, CACHE) smb_opts = (ACCESS_BASED_ENUM, CONTINUOUS_AVAIL, CACHE)
for smb_opt in smb_opts: for smb_opt in smb_opts:
opt_value = extra_specs.get('hpe3par:smb_%s' % smb_opt) opt_value = extra_specs.get('hp3par:smb_%s' % smb_opt)
if opt_value: if opt_value:
opt_key = SMB_EXTRA_SPECS_MAP[smb_opt] opt_key = SMB_EXTRA_SPECS_MAP[smb_opt]
createfshare_kwargs[opt_key] = opt_value createfshare_kwargs[opt_key] = opt_value

View File

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