protocol_access_mapping and backup_protocol_access_mapping can't be customized

Bug #2038607 reported by Takashi Kajinami
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Low
Takashi Kajinami

Bug Description

Description
===========

The protocol_access_mapping option and the backup_protocol_access_mapping option define mapping between access type and share protocols.

These options are supposed to allow multiple protocols per single access type, but currently this can't be defined in config file, mainly because current definition of these options makes oslo.config treats values in the dict as a flat string.

Steps to reproduce
==================
1. Add the following definitions in manila.conf

[DEFAULT]
backup_protocol_access_mapping='ip:nfs'

or

[DEFAULT]
backup_protocol_access_mapping='[ip:nfs]'

Expected result
===============
The given values are properly parsed.

Actual result
=============
The dict values are not parsed as list and causes logic error

Environment
===========
This issue was initially found in master but affects older stable branches

Logs & Configs
==============

Revision history for this message
Takashi Kajinami (kajinamit) wrote (last edit ):

When backup_protocol_access_mapping I see
```
2023-10-06 06:03:00.001 76696 DEBUG manila.service [-] backup_protocol_access_mapping = {'ip': ['nfs']} log_opt_values /usr/lib/python3.9/site-packages/oslo_config/cfg.py:2602
```
in manila data log when manila-data starts.

Then if I add
```
[DEFAULT]
backup_protocol_access_mapping=ip:nfs
```
to manila.conf then the start up log shows
```
2023-10-06 10:38:22.143 71627 DEBUG manila.service [-] backup_protocol_access_mapping = {'ip': 'nfs'} log_opt_values /usr/lib/python3.9/site-packages/oslo_config/cfg.py:2602
```

If I try the format described in the generated config file
```
[DEFAULT]
backup_protocol_access_mapping=ip:['nfs']
```
then this results in
```
2023-10-06 13:53:37.513 71612 DEBUG manila.service [-] backup_protocol_access_mapping = {'ip': "['nfs']"} log_opt_values /usr/lib/python3.9/site-packages/oslo_config/cfg.py:2602
```

Vida Haririan (vhariria)
Changed in manila:
importance: Undecided → Medium
Vida Haririan (vhariria)
Changed in manila:
importance: Medium → Undecided
importance: Undecided → Low
Vida Haririan (vhariria)
Changed in manila:
status: New → Triaged
Revision history for this message
Vida Haririan (vhariria) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/manila/+/898272

Changed in manila:
status: Triaged → In Progress
Revision history for this message
Takashi Kajinami (kajinamit) wrote :

Noticed tempest already has an implementation for a similar requirement.

https://github.com/openstack/tempest/blob/14f893e822e342ca64d50f4d86d0097225aa77c6/tempest/config.py#L745

Changed in manila:
assignee: nobody → Takashi Kajinami (kajinamit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.opendev.org/c/openstack/manila/+/898272
Committed: https://opendev.org/openstack/manila/commit/8f1e605adf22f4157a8fef15afb0637434d1a5bb
Submitter: "Zuul (22348)"
Branch: master

commit 8f1e605adf22f4157a8fef15afb0637434d1a5bb
Author: Takashi Kajinami <email address hidden>
Date: Sun Oct 15 12:49:08 2023 +0900

    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

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/2023.2)

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/manila/+/898572

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.