metadata option doesn't support unicode

Bug #1693151 reported by Alexey Stupnikov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Undecided
Alexey Stupnikov

Bug Description

Due to suboptimal type restriction it is impossible to provide unicode arguments with --metadata option.

Example:

cinder create --metadata 'test'='тест' 1
usage: cinder create [--consisgroup-id <consistencygroup-id>]
                     [--snapshot-id <snapshot-id>]
                     [--source-volid <source-volid>]
                     [--source-replica <source-replica>]
                     [--image-id <image-id>] [--image <image>] [--name <name>]
                     [--description <description>]
                     [--volume-type <volume-type>]
                     [--availability-zone <availability-zone>]
                     [--metadata [<key=value> [<key=value> ...]]]
                     [--hint <key=value>] [--allow-multiattach]
                     [<size>]
error: argument --metadata: invalid str value: u'test=u\u0442\u0435\u0441\u0442'
Try 'cinder help create' for more information.

Changed in python-cinderclient:
assignee: nobody → Alexey Stupnikov (astupnikov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-cinderclient (master)

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

Changed in python-cinderclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/467553
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=760cc59c5a34133f6b34118fd4b1e3b902c7e297
Submitter: Jenkins
Branch: master

commit 760cc59c5a34133f6b34118fd4b1e3b902c7e297
Author: Alexey Stupnikov <email address hidden>
Date: Wed May 24 12:33:57 2017 +0300

    Cleared type restrictions for metadata option

    It turns out that it is impossible to send unicode metadata
    values with some cinder commands. The reason is a type restriction
    that demands all values to be a 'str' type. As a result, it is
    impossible to use unicode.

    Change-Id: I1213b0d3b8177b670cd3e5d587fee9dabd971923
    Closes-bug: #1693151

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

This issue was fixed in the openstack/python-cinderclient 2.2.0 release.

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.