admin role judge exception caused the policy to fail

Bug #1788087 reported by zhangxiaohan
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
trio2o
New
Undecided
zhangxiaohan

Bug Description

Do the following:

1. source openrc admin admin
2. openstack --os-region-name=RegionOne token issue
3. curl -X POST http://127.0.0.1:19996/v1.0/pods -H "Content-Type: application/json" \
    -H "X-Auth-Token: $token" -d '{"pod": {"pod_name": "Pod2", "az_name": "az2"}}'

Error response following:

<html>
 <head>
  <title>401 Unauthorized</title>
 </head>
 <body>
  <h1>401 Unauthorized</h1>
  This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.<br /><br />
Unauthorized to create pods

Log following:

Aug 21 10:26:23 localhost trio2o-api[1410]: 2018-08-21 10:26:23.155 ERROR trio2o.common.policy req-321a1e34-c964-42dc-8e97-3076bb1a4126 None admin Policy doesn't allow this operation to be performed., admin_api:pods:create, {'project_id': u'5f31679db5114930adf52c54b995e7ec', 'user_id': u'f68ef4a379c847fdbf42e2c1e0536df6'}#033[00m: PolicyNotAuthorized: Policy doesn't allow this operation to be performed.
Aug 21 10:26:23 localhost trio2o-api[1410]: 2018-08-21 10:26:23.155 TRACE trio2o.common.policy Traceback (most recent call last):
Aug 21 10:26:23 localhost trio2o-api[1410]: 2018-08-21 10:26:23.155 TRACE trio2o.common.policy File "/opt/stack/trio2o/trio2o/common/policy.py", line 180, in enforce
Aug 21 10:26:23 localhost trio2o-api[1410]:2018-08-21 10:26:23.155 TRACE trio2o.common.policy do_raise=True, exc=exc, *args, **kwargs)
Aug 21 10:26:23 localhost trio2o-api[1410]: 2018-08-21 10:26:23.155 TRACE trio2o.common.policy File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 909, in enforce
Aug 21 10:26:23 localhost trio2o-api[1410]: 2018-08-21 10:26:23.155 TRACE trio2o.common.policy raise exc(*args, **kwargs)
Aug 21 10:26:23 localhost trio2o-api[1410]: 2018-08-21 10:26:23.155 TRACE trio2o.common.policy PolicyNotAuthorized: Policy doesn't allow this operation to be performed.

Changed in trio2o:
assignee: nobody → zhangxiaohan (zhangxh502)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.