summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorMark Washenberger <mark.washenberger@rackspace.com>2011-03-03 00:59:09 -0500
committerMark Washenberger <mark.washenberger@rackspace.com>2011-03-03 00:59:09 -0500
commit668cdc96b3f6fb412b9d1d4a3780744d6b2340b1 (patch)
tree15dc2499887033af284ee475574a26d43411f8d8 /nova/api
parentd33866923958b3529a812f4eef7dea4a6591a423 (diff)
more rigorous testing and error handling for os api personality
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 8908bbdca..73c787828 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -149,9 +149,13 @@ class Controller(wsgi.Controller):
"""
onset_files = []
for item in personality:
- path = item['path']
try:
- contents = base64.b64decode(item['contents'])
+ path = item['path']
+ contents = item['contents']
+ except TypeError:
+ raise exc.HTTPBadRequest(explanation='Bad personality format')
+ try:
+ contents = base64.b64decode(contents)
except TypeError:
raise exc.HTTPBadRequest(explanation=
'Personality content for %s cannot be decoded' % path)