keystoneclient tenant-get and tenant-delete with unicode name

Bug #1239485 reported by Morgan Fainberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
Won't Fix
Medium
Unassigned
python-openstackclient
Invalid
Low
Unassigned

Bug Description

If a unicode name is used with tenant-get or tenant-delete on the CLi instead of the "id", keystone client errors with an ascii decode error as shown in this example (standard Devstack on ubuntu 12.04). Looking at the keystone logs, it appears that this is an issue with how keystoneclient translates the name to the ID, as the logs do not show a call made for delete, just the initial list call.

Test below included fixes from https://review.openstack.org/#/c/51504/ in the keystone server (to properly handle unicode in the cache-layer. The delete by id on the unicode named tenant would fail without this fix).

vagrant@precise64:~/devstack$ keystone tenant-create --name testソ十豹c
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | |
| enabled | True |
| id | b8d413a42cfa47e89f5d9b9e7c5f0049 |
| name | testソ十豹c |
+-------------+----------------------------------+
vagrant@precise64:~/devstack$ keystone tenant-list
+----------------------------------+--------------------+---------+
| id | name | enabled |
+----------------------------------+--------------------+---------+
| b60d9e0442974483991b328959cd4657 | admin | True |
| a19965cdd7124bb6ab2eb0f265f5ee63 | alt_demo | True |
| fd336109933d49fc9095f3bee01f023e | demo | True |
| 7d0f69c7c41844d696039b800232e6ef | invisible_to_admin | True |
| c09ec3902d034bab9dd71aab70242bd2 | service | True |
| b8d413a42cfa47e89f5d9b9e7c5f0049 | testソ十豹c | True |
+----------------------------------+--------------------+---------+
vagrant@precise64:~/devstack$ keystone tenant-get testソ十豹c
'ascii' codec can't decode byte 0xe3 in position 13: ordinal not in range(128)
vagrant@precise64:~/devstack$ keystone tenant-delete testソ十豹c
'ascii' codec can't decode byte 0xe3 in position 13: ordinal not in range(128)
vagrant@precise64:~/devstack$ keystone tenant-delete invisible_to_admin
vagrant@precise64:~/devstack$ keystone tenant-list
+----------------------------------+-------------+---------+
| id | name | enabled |
+----------------------------------+-------------+---------+
| b60d9e0442974483991b328959cd4657 | admin | True |
| a19965cdd7124bb6ab2eb0f265f5ee63 | alt_demo | True |
| fd336109933d49fc9095f3bee01f023e | demo | True |
| c09ec3902d034bab9dd71aab70242bd2 | service | True |
| b8d413a42cfa47e89f5d9b9e7c5f0049 | testソ十豹c | True |
+----------------------------------+-------------+---------+
vagrant@precise64:~/devstack$ keystone tenant-delete b8d413a42cfa47e89f5d9b9e7c5f0049
vagrant@precise64:~/devstack$ keystone tenant-list
+----------------------------------+------------+---------+
| id | name | enabled |
+----------------------------------+------------+---------+
| b60d9e0442974483991b328959cd4657 | admin | True |
| a19965cdd7124bb6ab2eb0f265f5ee63 | alt_demo | True |
| fd336109933d49fc9095f3bee01f023e | demo | True |
| c09ec3902d034bab9dd71aab70242bd2 | service | True |
+----------------------------------+------------+---------+

Dolph Mathews (dolph)
Changed in python-keystoneclient:
importance: Undecided → Medium
Changed in python-keystoneclient:
assignee: nobody → Jaime Gil de Sagredo (jaimegildesagredo)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

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

Changed in python-keystoneclient:
assignee: Jaime Gil de Sagredo (jaimegildesagredo) → Wu Wenxiang (wu-wenxiang)
status: New → In Progress
Revision history for this message
Steve Martinelli (stevemar) wrote :

filing this against OSC since we have deprecated the CLI of keystoneclient

seems like it doesn't work in OSC either :(

Changed in python-keystoneclient:
status: In Progress → Won't Fix
Changed in python-openstackclient:
status: New → Confirmed
Changed in python-openstackclient:
importance: Undecided → Low
Changed in python-openstackclient:
assignee: nobody → Lin Hua Cheng (lin-hua-cheng)
Changed in python-keystoneclient:
assignee: Wu Wenxiang (wu-wenxiang) → nobody
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :
Download full text (3.2 KiB)

OSC seems to work fine for me.

(openstack) project list
+----------------------------------+------------------------------------------------------------------+
| ID | Name |
+----------------------------------+------------------------------------------------------------------+
| 0893b94994014f08a24a697b57943f9b | testソ十豹c |
| 0d94e10c940d4187b013ee4c9451d303 | service |
| 2b310a2b4bf74d1f82983549e38f69cc | 4b10513a94ae41ec86d1decbe2dd4f45-397479c1-ad9d-44e6-878b-19f755f |
| 4b10513a94ae41ec86d1decbe2dd4f45 | demo |
| a0ca28075634412d8ff3502e135cb07c | invisible_to_admin |
| a3191c5afc054387b8ef9c1076889fa7 | admin |
| d53c0d1bc350468bb5762278e3e05a6b | 4b10513a94ae41ec86d1decbe2dd4f45-c7f70bf3-0d02-484b-b4b1-a289479 |
| d741b894c70e4c68b32de7efe03fa858 | alt_demo |
| e540f234767f40a4bb2edc28f7203ef3 | 4b10513a94ae41ec86d1decbe2dd4f45-38d17acb-c1b4-4333-8f42-cd16f1d |
+----------------------------------+------------------------------------------------------------------+

(openstack) project show testソ十豹c
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | |
| domain_id | default |
| enabled | True |
| id | 0893b94994014f08a24a697b57943f9b |
| is_domain | False |
| name | testソ十豹c |
| parent_id | None |
+-------------+----------------------------------+

(openstack) project delete testソ十豹c
(openstack) project list
+----------------------------------+------------------------------------------------------------------+
| ID | Name |
+----------------------------------+------------------------------------------------------------------+
| 0d94e10c940d4187b013ee4c9451d303 | service |
| 2b310a2b4bf74d1f82983549e38f69cc | 4b10513a94ae41ec86d1decbe2dd4f45-397479c1-ad9d-44e6-878b-19f755f |
| 4b10513a94ae41ec86d1decbe2dd4f45 | demo |
| a0ca28075634412d8ff3502e135cb07c | invisible_to_admin |
| a3191c5afc054387b8ef9c1076889fa7 | admin |
| d53c0d1bc350468bb5762278e3e05a6b | 4b10513a94ae41ec86d1decbe2dd4f45-c7f70bf3-0d02-484b-b4b1-a289479 |
| d741b894c70e4c68b32de7efe03fa858 | alt_demo |
| e540f234767f40a4bb2edc28f7203ef3 | 4b10513a94ae41ec86d1decbe2dd4f45-38d17acb-c1b4-4333-8f42-cd16...

Read more...

Changed in python-openstackclient:
status: Confirmed → Invalid
assignee: Lin Hua Cheng (lin-hua-cheng) → nobody
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.