summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorKen'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>2013-01-31 22:05:14 +0900
committerKen'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>2013-02-07 10:52:48 +0900
commit77c30189abe53326d99241a465b702ad7eed6b03 (patch)
tree47a98c75b6d0f4aea223c4f424c5f0e96a600838 /nova/api
parent08499b9c2d6aa9c4f416afc5672dcf474fca0fbb (diff)
Fix inject_files for storing binary file.
Now a nova-api server decodes injected_files by base64 after receiving encoded files from nova-client. And the server fails to publish run_instance because utf8 codec can't decode due to binary data. This patch fixes this problem, because the base64 decode is operated when a nova-compute server receives injected_files from a nova-api server. Fixes bug 1112134 Change-Id: I664134c74893a970de4464161071692a5b2b5ce7
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/servers.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index bf3f4cacc..723997eba 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -605,8 +605,7 @@ class Controller(wsgi.Controller):
except TypeError:
expl = _('Bad personality format')
raise exc.HTTPBadRequest(explanation=expl)
- contents = self._decode_base64(contents)
- if contents is None:
+ if self._decode_base64(contents) is None:
expl = _('Personality content for %s cannot be decoded') % path
raise exc.HTTPBadRequest(explanation=expl)
injected_files.append((path, contents))