If the volume type name contains chinese charactor, cinder quota-show would failed.
Following steps is the way to reproduce the issue (on devstack with stable/newton version):
$ cinder type-create volume_中文类型
+--------------------------------------+-----------------+-------------+-----------+
| ID | Name | Description | Is_Public |
+--------------------------------------+-----------------+-------------+-----------+
| a2af1661-76ef-4279-8348-326f74ea4b83 | volume_中文类型 | - | True |
+--------------------------------------+-----------------+-------------+-----------+
$ cinder quota-show 1678d8af54f6449bba2a4bfe04d65840
ERROR: 'ascii' codec can't encode characters in position 17-20: ordinal not in range(128)
$ cinder --debug quota-show 1678d8af54f6449bba2a4bfe04d65840
DEBUG:keystoneauth.session:REQ: curl -g -i -X GET http://192.168.0.93:5000/v2.0 -H "Accept: application/json" -H "User-Agent: cinder keystoneauth1/2.12.3 python-requests/2.11.1 CPython/2.7.6"
DEBUG:keystoneauth.session:RESP: [200] Date: Wed, 11 Oct 2017 06:29:26 GMT Server: Apache/2.4.7 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-5a60fa66-6fa1-46ed-8935-2cd1c30dc1e3 Content-Length: 346 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: application/json
RESP BODY: {"version": {"status": "deprecated", "updated": "2016-08-04T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://192.168.0.93/identity/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}
DEBUG:keystoneauth.identity.v2:Making authentication request to http://192.168.0.93/identity/v2.0/tokens
DEBUG:keystoneauth:REQ: curl -g -i -X GET http://192.168.0.93:8776/v2/1678d8af54f6449bba2a4bfe04d65840/os-quota-sets/1678d8af54f6449bba2a4bfe04d65840?usage=False -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}54278581d3bf1d0c183b1a6e483b252e29c2393e"
DEBUG:keystoneauth:RESP: [200] X-Compute-Request-Id: req-1bfb3873-f7d3-49df-beec-bede7ff7630d Content-Type: application/json Content-Length: 407 X-Openstack-Request-Id: req-1bfb3873-f7d3-49df-beec-bede7ff7630d Date: Wed, 11 Oct 2017 06:29:27 GMT Connection: keep-alive
RESP BODY: {"quota_set": {"per_volume_gigabytes": -1, "volumes_lvmdriver-1": -1, "gigabytes": 1000, "backup_gigabytes": 1000, "gigabytes_volume_\u4e2d\u6587\u7c7b\u578b": -1, "snapshots": 10, "gigabytes_lvmdriver-1": -1, "volumes_volume_\u4e2d\u6587\u7c7b\u578b": -1, "volumes": 10, "snapshots_volume_\u4e2d\u6587\u7c7b\u578b": -1, "backups": 10, "id": "1678d8af54f6449bba2a4bfe04d65840", "snapshots_lvmdriver-1": -1}}
GET call to volumev2 for http://192.168.0.93:8776/v2/1678d8af54f6449bba2a4bfe04d65840/os-quota-sets/1678d8af54f6449bba2a4bfe04d65840?usage=False used request id req-1bfb3873-f7d3-49df-beec-bede7ff7630d
DEBUG:cinderclient.client:GET call to volumev2 for http://192.168.0.93:8776/v2/1678d8af54f6449bba2a4bfe04d65840/os-quota-sets/1678d8af54f6449bba2a4bfe04d65840?usage=False used request id req-1bfb3873-f7d3-49df-beec-bede7ff7630d
ERROR: 'ascii' codec can't encode characters in position 17-20: ordinal not in range(128)
I test this questions on devstack with master version, all thing is ok.
$---cinder type-create volume_ 中文类型--- ------- ------- ------- ------- ----+-- ------- ------- -+----- ------- -+----- ------+ ------- ------- ------- ------- ----+-- ------- ------- -+----- ------- -+----- ------+ 20c9-421f- 9c02-aebae6abba a7 | volume_中文类型 | - | True | ------- ------- ------- ------- ----+-- ------- ------- -+----- ------- -+----- ------+ f875306f8662e03 fe ------- ------- ------- +------ -+ ------- ------- ------- +------ -+ volume_ 中文类型 | -1 | gigabytes | -1 | volume_ 中文类型 | -1 | ------- ------- ------- +------ -+
| ID | Name | Description | Is_Public |
+------
| a2501c44-
+------
cinder quota-show c089e24684eb424
+------
| Property | Value |
+------
| backup_gigabytes | 1000 |
| backups | 10 |
| gigabytes | 1000 |
| gigabytes_ceph-type | -1 |
| gigabytes_lvmdriver | -1 |
| gigabytes_
| groups | 10 |
| per_volume_
| snapshots | 50 |
| snapshots_ceph-type | -1 |
| snapshots_lvmdriver | -1 |
| snapshots_
| volumes | 50 |
| volumes_ceph-type | -1 |
| volumes_lvmdriver | -1 |
| volumes_volume_中文类型 | -1 |
+------