cinderclient doesn't support Unicode metadata

Bug #1693710 reported by Alexey Stupnikov on 2017-05-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
High
MOS Cinder
8.0.x
High
Alexey Stupnikov
9.x
High
Alexey Stupnikov

Bug Description

There is upstream bug #1693151. We need to backport the solution to our private branches.

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 mos:
importance: Undecided → High
description: updated

Fix proposed to branch: openstack-ci/fuel-8.0/liberty
Change author: Alexey Stupnikov <email address hidden>
Review: https://review.fuel-infra.org/35511

Fix proposed to branch: 9.0/mitaka
Change author: Alexey Stupnikov <email address hidden>
Review: https://review.fuel-infra.org/35515

Fix proposed to branch: 10.0/newton
Change author: Alexey Stupnikov <email address hidden>
Review: https://review.fuel-infra.org/35516

Changed in mos:
status: Confirmed → In Progress

Reviewed: https://review.fuel-infra.org/35511
Submitter: Pkgs Jenkins <email address hidden>
Branch: openstack-ci/fuel-8.0/liberty

Commit: 055e2a0d19fd8f3253c2e8888c24b0f8476ccd4b
Author: Alexey Stupnikov <email address hidden>
Date: Tue Jun 6 08:44:53 2017

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.

This patch is based on upstream review
https://review.openstack.org/#/c/467553/

Change-Id: I1213b0d3b8177b670cd3e5d587fee9dabd971923
Closes-bug: #1693710

Reviewed: https://review.fuel-infra.org/35515
Submitter: Pkgs Jenkins <email address hidden>
Branch: 9.0/mitaka

Commit: 36ec3e31e386eaa5711fa354dcd08db8333441c2
Author: Alexey Stupnikov <email address hidden>
Date: Tue Jun 6 08:45:25 2017

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.

This patch is based on upstream review
https://review.openstack.org/#/c/467553/

Change-Id: I1213b0d3b8177b670cd3e5d587fee9dabd971923
Closes-bug: #1693710

Changed in mos:
assignee: Alexey Stupnikov (astupnikov) → MOS Cinder (mos-cinder)

Verified on Fuel 8.0 MU-5:

root@node-1:~# cinder create --metadata 'test'='тест' 1
+---------------------------------------+----------------------------------------+
| Property | Value |
+---------------------------------------+----------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2017-07-19T07:28:05.000000 |
| description | None |
| encrypted | False |
| id | 3a2523c8-b865-4faf-a933-b7d3fb41d796 |
| metadata | {u'test': u'\u0442\u0435\u0441\u0442'} |
| migration_status | None |
| multiattach | False |
| name | None |
| os-vol-host-attr:host | rbd:volumes#RBD-backend |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | 3d96d874b70545d0868a6269f3c72cb6 |
| os-volume-replication:driver_data | None |
| os-volume-replication:extended_status | None |
| replication_status | disabled |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| user_id | 17c562d43bc149208d6186af1493afc6 |
| volume_type | None |
+---------------------------------------+----------------------------------------+

summary: - metadata option doesn't support unicode
+ cinderclient doesn't support Unicode metadata
Vladimir Jigulin (vjigulin) wrote :

Verified on 9.0-2017-09-01 snapshot
Without proposed: error: argument --metadata: invalid str value: u'test=u\u0442\u0435\u0441\u0442'
With proposed: no errors
root@node-1:~# cinder create --metadata 'test'='тест' 1|grep metadata
| metadata | {u'test': u'\u0442\u0435\u0441\u0442'} |

Reviewed: https://review.fuel-infra.org/35516
Submitter: Pkgs Jenkins <email address hidden>
Branch: 10.0/newton

Commit: 673f0ff318e4c1fa14ad96b2324ab59dc33d976d
Author: Alexey Stupnikov <email address hidden>
Date: Tue Jun 6 08:45:32 2017

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.

This patch is based on upstream review
https://review.openstack.org/#/c/467553/

Change-Id: I1213b0d3b8177b670cd3e5d587fee9dabd971923
Closes-bug: #1693710

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

Other bug subscribers