From 77c30189abe53326d99241a465b702ad7eed6b03 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Thu, 31 Jan 2013 22:05:14 +0900 Subject: 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 --- nova/api/openstack/compute/servers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nova/api') 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)) -- cgit