Skip to content

Instantly share code, notes, and snippets.

@j-griffith
Created April 26, 2017 16:31
Show Gist options
  • Select an option

  • Save j-griffith/3f6f3b88a9ad2acb2d46e4e546b5bc8a to your computer and use it in GitHub Desktop.

Select an option

Save j-griffith/3f6f3b88a9ad2acb2d46e4e546b5bc8a to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import os
import brick_cinderclient_ext
from cinderclient import client
from cinderclient.contrib import noauth
from keystoneauth1 import loading
from keystoneauth1 import session
bypass_url = "http://localhost:8776/v3"
project_id = "cinderflex"
auth_plugin = noauth.CinderNoAuthPlugin('',
project_id,
None,
bypass_url)
loader = loading.get_plugin_loader('password')
auth = loader.load_from_options(auth_url=bypass_url,
username="foo",
password="password",
project_id="cinderflex",
user_domain_id="default",
project_domain_id="default")
sess = session.Session(auth=auth)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment