Fix parsing of protocol access mapping options

The protocol access mapping options should accept dictionaries whose
values are lists, not strings.

Closes-Bug: 2038607
Change-Id: Id75082507cee27bef03318dc3af5ae5c1b233505
This commit is contained in:
Takashi Kajinami 2023-10-15 12:49:08 +09:00
parent 22e568d1d3
commit 8f1e605adf
3 changed files with 14 additions and 2 deletions

View File

@ -20,6 +20,7 @@ import os
import shutil
from oslo_config import cfg
from oslo_config import types
from oslo_log import log
from oslo_service import periodic_task
from oslo_utils import excutils
@ -67,8 +68,9 @@ backup_opts = [
default=['lost+found'],
help="List of files and folders to be ignored when backing up "
"shares. Items should be names (not including any path)."),
cfg.DictOpt(
cfg.Opt(
'backup_protocol_access_mapping',
type=types.Dict(types.List(types.String(), bounds=True)),
default={'ip': ['nfs']},
help="Protocol access mapping for backup. Should be a "
"dictionary comprised of "

View File

@ -21,6 +21,7 @@ Drivers for shares.
import time
from oslo_config import cfg
from oslo_config import types
from oslo_log import log
from manila.common import constants
@ -109,8 +110,9 @@ share_opts = [
"specify the executable with all necessary parameters for the "
"protocol supported. 'path' template element is required. It is "
"advisable to separate different commands per backend."),
cfg.DictOpt(
cfg.Opt(
'protocol_access_mapping',
type=types.Dict(types.List(types.String(), bounds=True)),
default={
'ip': ['nfs'],
'user': ['cifs'],

View File

@ -0,0 +1,8 @@
---
fixes:
- |
`bug 2038607 <https://bugs.launchpad.net/manila/+bug/2038607>`_: Fixed
parse of the protcol_access_mapping option and
the backup_protocol_access_mapping option. This change requires that
the values used for these options should be formatted like
`key0=[value00, value01],key1=[value10]`.