os-brick fail to get password from config file

Bug #1883654 reported by hamza on 2020-06-16
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-brick
Undecided
Unassigned
Train
Undecided
hamza

Bug Description

for the change https://wiki.openstack.org/wiki/OSSN/OSSN-0086
in os-brick this line
https://github.com/openstack/os-brick/blob/b5891702cc24b0c9cedf6961d3223a37830341b9/os_brick/privileged/scaleio.py#L99
gives an error
Error getting ScaleIO connector password from configuration file: ConfigParser instance has no attribute '__getitem__'

i think it should be config.get(config_option, 'san_password')

steps to reproduce
openstack server add volume <server-id> <volume-id>

hamza (alqtaishat) wrote :

this fails on os-brick 2.8.5 using nova rocky

Sean McGinnis (sean-mcginnis) wrote :

These changes to os-brick have not been included in a stable release yet. Need to make sure nova, cinder, and os-brick all get updated with the credential handling change.

tags: added: dell drivers
hamza (alqtaishat) wrote :

i already created the configuration file with the password and got all the changes needed
and changed the code to config.get(config_option, 'san_password') and it worked

Brian Rosmaita (brian-rosmaita) wrote :

I think the problem is that the parser['group']['key'] syntax was introduced in Python 3, so when you run under python 2.7 (which is still supported in Rocky), you get the "ConfigParser instance has no attribute '__getitem__'" error.

See https://docs.python.org/3/whatsnew/3.2.html#configparser

affects: cinder → os-brick
no longer affects: cinder/train
no longer affects: cinder/stein
no longer affects: cinder/rocky
no longer affects: cinder/queens

Change abandoned by Sean McGinnis (<email address hidden>) on branch: stable/rocky
Review: https://review.opendev.org/736059

Reviewed: https://review.opendev.org/735989
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=12d252db9cb9deffea3c87b86ea71b3013d93892
Submitter: Zuul
Branch: stable/train

commit 12d252db9cb9deffea3c87b86ea71b3013d93892
Author: hamalq <email address hidden>
Date: Tue Jun 16 17:59:07 2020 +0000

    Fix "Remove VxFlex OS credentials" regression

    Change Ia1d2b2151e5676037d40bfaf388b54023fc37093 uses a ConfigParser
    instance in a way that is incompatible with python 2.7, resulting in
    a "ConfigParser instance has no attribute '__getitem__'" error. This
    patch accesses the ConfigParser using the "old" API that works in both
    Python 2.7 and Python 3 and adds some tests.

    Co-authored-by: Brian Rosmaita <email address hidden>

    Change-Id: Ie2db587c3bc379acd53cfd449788d171ae58dec5
    Closes-Bug: 1883654

Change abandoned by hamza (<email address hidden>) on branch: stable/rocky
Review: https://review.opendev.org/736415
Reason: should be cherry picked from stein

Reviewed: https://review.opendev.org/736395
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=750999db0de0fcfc923cd453add808ca42a4e2b4
Submitter: Zuul
Branch: stable/stein

commit 750999db0de0fcfc923cd453add808ca42a4e2b4
Author: hamalq <email address hidden>
Date: Tue Jun 16 17:59:07 2020 +0000

    Fix "Remove VxFlex OS credentials" regression

    Change I89bd58d79e5cd74cf283d026ada486b7f7122980 uses a ConfigParser
    instance in a way that is incompatible with python 2.7, resulting in
    a "ConfigParser instance has no attribute '__getitem__'" error. This
    patch accesses the ConfigParser using the "old" API that works in both
    Python 2.7 and Python 3 and adds some tests.

    Co-authored-by: Brian Rosmaita <email address hidden>

    Change-Id: Ie2db587c3bc379acd53cfd449788d171ae58dec5
    Closes-Bug: 1883654
    (cherry picked from commit 12d252db9cb9deffea3c87b86ea71b3013d93892)

tags: added: in-stable-stein

Reviewed: https://review.opendev.org/736415
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=867767ffdae124fcdb9b04a9089e226689c476d7
Submitter: Zuul
Branch: stable/rocky

commit 867767ffdae124fcdb9b04a9089e226689c476d7
Author: hamalq <email address hidden>
Date: Tue Jun 16 17:59:07 2020 +0000

    Fix "Remove VxFlex OS credentials" regression

    Change I10a8aaddbf7dd09830cd4189cd1f99c0ad1f3b60 uses a ConfigParser
    instance in a way that is incompatible with python 2.7, resulting in
    a "ConfigParser instance has no attribute '__getitem__'" error. This
    patch accesses the ConfigParser using the "old" API that works in both
    Python 2.7 and Python 3 and adds some tests.

    Co-authored-by: Brian Rosmaita <email address hidden>

    Change-Id: Ie2db587c3bc379acd53cfd449788d171ae58dec5
    Closes-Bug: 1883654
    (cherry picked from commit 12d252db9cb9deffea3c87b86ea71b3013d93892)
    (cherry picked from commit 750999db0de0fcfc923cd453add808ca42a4e2b4)
    Conflicts:
    - remove os_brick/privileged/scaleio.py (function with bug is in the
      connector in this branch)
    - move the test file to tests/initiator/connectors/
    - modify the unit tests because the config file is accessed differently
      in this branch

tags: added: in-stable-rocky

Reviewed: https://review.opendev.org/736749
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=f4019f7831e5366f7e5e40e9715f3bd981f2b7df
Submitter: Zuul
Branch: stable/queens

commit f4019f7831e5366f7e5e40e9715f3bd981f2b7df
Author: hamalq <email address hidden>
Date: Tue Jun 16 17:59:07 2020 +0000

    Fix "Remove VxFlex OS credentials" regression

    Change Ib7778ba9d38a68d8b56ca632c5f1c353d55830b0 uses a ConfigParser
    instance in a way that is incompatible with python 2.7, resulting in
    a "ConfigParser instance has no attribute '__getitem__'" error. This
    patch accesses the ConfigParser using the "old" API that works in both
    Python 2.7 and Python 3 and adds some tests.

    Co-authored-by: Brian Rosmaita <email address hidden>

    Change-Id: Ie2db587c3bc379acd53cfd449788d171ae58dec5
    Closes-Bug: 1883654
    (cherry picked from commit 12d252db9cb9deffea3c87b86ea71b3013d93892)
    (cherry picked from commit 750999db0de0fcfc923cd453add808ca42a4e2b4)
    Conflicts:
    - remove os_brick/privileged/scaleio.py (function with bug is in the
      connector in this branch)
    - move the test file to tests/initiator/connectors/
    - modify the unit tests because the config file is accessed differently
      in this branch
    (cherry picked from commit 867767ffdae124fcdb9b04a9089e226689c476d7)

tags: added: in-stable-queens

Reviewed: https://review.opendev.org/740318
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=1e56b950e2984a6829f5e7cced28ab5e82d28d4b
Submitter: Zuul
Branch: stable/pike

commit 1e56b950e2984a6829f5e7cced28ab5e82d28d4b
Author: hamalq <email address hidden>
Date: Tue Jun 16 17:59:07 2020 +0000

    Fix "Remove VxFlex OS credentials" regression

    Change Ib7778ba9d38a68d8b56ca632c5f1c353d55830b0 uses a ConfigParser
    instance in a way that is incompatible with python 2.7, resulting in
    a "ConfigParser instance has no attribute '__getitem__'" error. This
    patch accesses the ConfigParser using the "old" API that works in both
    Python 2.7 and Python 3 and adds some tests.

    Co-authored-by: Brian Rosmaita <email address hidden>

    Change-Id: Ie2db587c3bc379acd53cfd449788d171ae58dec5
    Closes-Bug: 1883654
    (cherry picked from commit 12d252db9cb9deffea3c87b86ea71b3013d93892)
    (cherry picked from commit 750999db0de0fcfc923cd453add808ca42a4e2b4)
    Conflicts:
    - remove os_brick/privileged/scaleio.py (function with bug is in the
      connector in this branch)
    - move the test file to tests/initiator/connectors/
    - modify the unit tests because the config file is accessed differently
      in this branch
    (cherry picked from commit 867767ffdae124fcdb9b04a9089e226689c476d7)
    (cherry picked from commit f4019f7831e5366f7e5e40e9715f3bd981f2b7df)

tags: added: in-stable-pike
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers