huawei driver encodes configuration string error for py3

Bug #1613242 reported by Yingzhe Zeng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Undecided
Yingzhe Zeng

Bug Description

While huawei driver reads username/password configuration from configuration file,
if the item string is plain text, then driver'll try to encode this text and write back to configuration file.
But for py3, the string converting logic'll add some extra words to the encoded byte string,
and incur the following string decoding failed.

Changed in manila:
assignee: nobody → Yingzhe Zeng (zengyingzhe)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

Fix proposed to branch: master
Review: https://review.openstack.org/367103

Changed in manila:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/368538

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on manila (master)

Change abandoned by Yingzhe Zeng (<email address hidden>) on branch: master
Review: https://review.openstack.org/368538
Reason: Sorry. Commit wrong.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/367103
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=d14e906ac0b34cee1cbca32be33d511385e74328
Submitter: Jenkins
Branch: master

commit d14e906ac0b34cee1cbca32be33d511385e74328
Author: zengyingzhe <email address hidden>
Date: Thu Sep 8 14:23:31 2016 +0800

    Fix huawei driver username/password encoding bug

    While huawei driver reads username/password configuration from
    configuration file, if the value is plain text, huawei driver'll
    encode this text and write back to configuration file.

    huawei driver leverages base64.b64encode to implement the encoding.
    The encoded result is a byte string, and then is converted to
    unicode string.

    In py2, this works fine. However, in py3, the unicode string
    converted from byte string is like "b'***'", *** is the orginal
    string supposed to be.

    So the encoded string is broken, and exception occurs while decoding
    from it.

    This patch fixes the incorrect unicode string converting and make
    the encoded result string right.

    Change-Id: I2483ae4999484b3a67c7d443f9b3cc214a3473b2
    Closes-Bug: #1613242

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 4.0.0.0b1

This issue was fixed in the openstack/manila 4.0.0.0b1 development milestone.

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.