]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Only split roles if they are not None.
authorIan Main <imain@redhat.com>
Fri, 1 Mar 2013 04:30:59 +0000 (23:30 -0500)
committerGerrit Code Review <review@openstack.org>
Tue, 12 Mar 2013 21:18:45 +0000 (21:18 +0000)
Change-Id: I2fbfbd6f6b1c898f7032744f9411821d5d97048c
Signed-off-by: Ian Main <imain@redhat.com>
Fixes: bug #1136891
heat/common/context.py

index 80332c8c986c358d978b918326352c0c64422b5c..8c28b897d05cfe690419703a93d5ec1ed1096dbd 100644 (file)
@@ -186,7 +186,10 @@ class ContextMiddleware(wsgi.Middleware):
             tenant = headers.get('X-Tenant-Name')
             tenant_id = headers.get('X-Tenant-Id')
             auth_url = headers.get('X-Auth-Url')
-            roles = headers.get('X-Roles').split(',')
+            roles = headers.get('X-Roles')
+            if roles is not None:
+                roles = roles.split(',')
+
         except Exception:
             raise exception.NotAuthenticated()