# unicode in metadata value
$ glance image-update --property ascii_key=unicode-${BB} 7a40d9d3-ee1d-48a1-8e2a-6c8ae01b7b4c
'ascii' codec can't decode byte 0xe2 in position 45: ordinal not in range(128)
# unicode in metadata key
$ glance image-update --property unicode_key_${CC}=ascii-value 7a40d9d3-ee1d-48a1-8e2a-6c8ae01b7b4c
'ascii' codec can't decode byte 0xe2 in position 38: ordinal not in range(128)
NOTE: The glance API can handle unicode fine:
$ VAL=$(echo -e "\u2645")
$ KEY=$(echo -e "\u262e")
$ echo $VAL
♅
$ echo $KEY
☮
The python-glanceclient chokes on unicode for image names, metadata keys, and metadata values.
Examples:
# unicode in name
$ MERC=$(echo -e "\u263f")
$ echo $MERC
☿
$ glance image-create --name Freddy-$MERC
'ascii' codec can't decode byte 0xe2 in position 30: ordinal not in range(128)
$ BB=$(echo -e "\u2047")
$ CC=$(echo -e "\u2048")
$ echo $BB
⁇
$ echo $CC
⁈
# unicode in metadata value unicode- ${BB} 7a40d9d3- ee1d-48a1- 8e2a-6c8ae01b7b 4c
$ glance image-update --property ascii_key=
'ascii' codec can't decode byte 0xe2 in position 45: ordinal not in range(128)
# unicode in metadata key key_${CC} =ascii- value 7a40d9d3- ee1d-48a1- 8e2a-6c8ae01b7b 4c
$ glance image-update --property unicode_
'ascii' codec can't decode byte 0xe2 in position 38: ordinal not in range(128)
NOTE: The glance API can handle unicode fine:
$ VAL=$(echo -e "\u2645")
$ KEY=$(echo -e "\u262e")
$ echo $VAL
♅
$ echo $KEY
☮
curl -X PUT \ meta-property- $KEY: the-key-is-unicode" \ meta-property- unicode_ value: my-$VAL" \ 50.57.98. 195:9292/ v1/images/ 7a40d9d3- ee1d-48a1- 8e2a-6c8ae01b7b 4c
-H "User-Agent: curl-by-hand" \
-H "X-Auth-Token: $AUTH_TOKEN" \
-H "x-image-meta-name: unicode-$VAL" \
-H "x-image-
-H "x-image-
http://
{ 2c08fbe9016e168 ca4",
"container_ format" : "ami",
"created_ at": "2012-10- 01T18:23: 14",
"deleted_ at": null,
"disk_ format" : "ami", ee1d-48a1- 8e2a-6c8ae01b7b 4c",
"is_public" : false, 4c9676abc181008 38c",
"properties" : {
"unicode_ value": "my-\u2645",
"\ u262e": "the-key- is-unicode"
"protected" : false,
"updated_ at": "2012-10- 03T18:22: 27"
"image": {
"checksum": "9490463a2a6db0
"deleted": false,
"id": "7a40d9d3-
"min_disk": 0,
"min_ram": 0,
"name": "unicode-\u2645",
"owner": "637807f80e4344
},
"size": 25165824,
"status": "active",
}
}