Ask Your Question

What's the session in `def validate_user_has_role(self, session, user, role)` in openstacksdk?

asked 2017-10-27 04:53:55 -0500

liaodalin19903 gravatar image

What's the session in def validate_user_has_role(self, session, user, role) in openstacksdk?

In identity/

def validate_user_has_role(self, session, user, role):
    """Validates that a user has a role on a project"""
    url = utils.urljoin(self.base_path,, 'users',
              , 'roles',
    resp = session.head(url, endpoint_filter=self.service)
    if resp.status_code == 201:
        return True
    return False

I don't know the session is what, I delivery the request.session, i get :

'SessionStore' object has no attribute 'head'.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-10-27 05:26:30 -0500

liaodalin19903 gravatar image
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-10-27 04:53:55 -0500

Seen: 112 times

Last updated: Oct 27 '17