Ask Your Question
0

set accaunt quota in swift

asked 2013-05-17 10:41:27 -0600

kelfen gravatar image

When I try to set the account-quota with reseller admin i have this error:

~ # swift -V 2 -A http://???:5000/v2.0 -U reseller:reseller -K passwd post -m quota-bytes:1024000

Account POST failed: http://xxxxx:8888/v1/AUTH_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (http://xxxxx:8888/v1/AUTH_xxxxxxxxxxx...) 403 Forbidden [first 60 chars of response]

Forbidden

Access was denied to this resource

swift/common/middleware/account_quotas.py

77 if request.environ.get('reseller_request') is True:
78 if new_quota and not new_quota.isdigit():
79 return HTTPBadRequest() 80 return self.app 80 return self.app

I am sure that the user is a ResellerAdmin but this condition "request.environ.get('reseller_request')" is never True:

Can you help me? Thanks

My proxy-server.conf --> http://paste.openstack.org/show/37388/

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
0

answered 2013-05-17 12:43:30 -0600

updated 2015-08-28 03:26:22 -0600

Hi Bellantuono, I have solved the same problem by modify the swift/common/middleware/account_quotas.py

##################################

new_quota = request.headers.get('X-Account-Meta-Quota-Bytes')

#Add by kevin start
eccp_roles = request.environ.get('HTTP_X_ROLES', '')
if isinstance(eccp_roles, basestring):
    if (set(eccp_roles.split(',')) & set({'reseller','reseller_admin','ResellerAdmin'})):
        request.environ['reseller_request'] = True
#Add by kevin end

if request.environ.get('reseller_request') is True:
    if new_quota and not new_quota.isdigit():
        return HTTPBadRequest()
    return self.app
#################################

It seems that this part is not used for keystone.

Good luck

edit flag offensive delete link more
0

answered 2013-05-17 13:47:29 -0600

kelfen gravatar image

Thanks Kevin Shao, that solved my question.

edit flag offensive delete link more
0

answered 2013-05-17 13:47:18 -0600

kelfen gravatar image

Hi Kevin, Thanks a lot! Account Quotas working properly now.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-05-17 10:41:27 -0600

Seen: 187 times

Last updated: Aug 28 '15