Ask Your Question
0

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

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

liaodalin19903 gravatar image

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

In identity/project.py:

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, self.id, 'users',
                        user.id, 'roles', role.id)
    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
0

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

liaodalin19903 gravatar image
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: 2017-10-27 04:53:55 -0600

Seen: 65 times

Last updated: Oct 27 '17