run "nova evacuate" command, 'can't be encoded'error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance Client |
Invalid
|
Undecided
|
Unassigned | ||
OpenStack Security Advisory |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
I have some trouble when run 'nova evacuate'command
details:
1.I have two hosts, host1 is controler and conpute services, host2 is only compute service
2.stop the host2's compute service
3.run 'nova evacuate'command on the host1, return error
the host1's compute log:
| created | 2014-08-
| fault | {"message": "<type 'NoneType'> can't be encoded", "code": 500, "details": " File \"/usr/
| | return function(self, context, *args, **kwargs) |
| | File \"/usr/
| | image_meta = _get_image_
| | File \"/usr/
| | return image_service.
| | File \"/usr/
| | image = self._client.
| | File \"/usr/
| | image = self._client.
| | File \"/usr/
| | return getattr(
| | File \"/usr/
| | % urllib.
| | File \"/usr/
| | return self._http_
| | File \"/usr/
| | kwargs['headers'] = self.encode_
| | File \"/usr/
| | return dict([(to_str(h), to_str(v)) for h, v in headers.
| | File \"/usr/
| | raise TypeError(\"%s can't be encoded\" % type(text)) |
| | ", "created": "2014-08-
| flavor | m1.tiny (1df8ba6d-
| hostId | 36ca539f1fd65bf
| id | 5b413785-
| image | cirros (d9af9100-
tags: | added: glanceclient |
information type: | Private Security → Public |
Changed in ossa: | |
status: | New → Won't Fix |
no longer affects: | glance |
At present, I change the /usr/lib/ python2. 7/site- packages/ glanceclient/ openstack/ common/ strutils. py safe_encode function
encoding= 'utf-8' , errors='strict'):
encoding= 'utf-8' , errors='ignore'):
and avoid this issue.
e.g:
def safe_encode(text, incoming=None,
=>
def safe_encode(text, incoming=None,
"errors" from 'strict' to 'ignore'