diff options
| author | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-03-03 00:59:09 -0500 |
|---|---|---|
| committer | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-03-03 00:59:09 -0500 |
| commit | 668cdc96b3f6fb412b9d1d4a3780744d6b2340b1 (patch) | |
| tree | 15dc2499887033af284ee475574a26d43411f8d8 /nova/api | |
| parent | d33866923958b3529a812f4eef7dea4a6591a423 (diff) | |
more rigorous testing and error handling for os api personality
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/servers.py | 8 |
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) |
