Skip to content

Instantly share code, notes, and snippets.

@stavxyz
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save stavxyz/a559ca013077d8abb57b to your computer and use it in GitHub Desktop.

Select an option

Save stavxyz/a559ca013077d8abb57b to your computer and use it in GitHub Desktop.

😆

https://github.com/checkmate/pawn/blob/f7afc608b2faa6125006d56485ae97beb345acd6/pawn/rackspace/identity.py#L17-L103

The requests.session and CheckmateClient stuff I wrote does this exact thing under the hood.

from pawn import client
from pawn.rackspace import AuthRackspaceIdentity, AuthRacker

api = client.CheckmateClient()
racker = AuthRacker('username', 'password')
api.auth.register(racker)
# or you could use the shortcut, api = racker.create_client()

# and for any cloud account
cloud = AuthRackspaceIdentity('apikey')
api.auth.register(cloud)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment