Skip to content

Instantly share code, notes, and snippets.

@rahulunair
Last active September 26, 2016 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulunair/bdfcae11c7da5e264e3f15ab936041db to your computer and use it in GitHub Desktop.
Save rahulunair/bdfcae11c7da5e264e3f15ab936041db to your computer and use it in GitHub Desktop.
from keystoneauth1 import identity
from keystoneauth1 import session
from cinderclient.client import Client
auth = identity.v3.Password(auth_url="http://127.0.0.1:35357",
project_name="demo",
project_domain_name="default",
user_domain_name="default",
username="admin",
password="secret")
def _get_client():
return Client(2, auth_url="http://127.0.0.1:35357",
session=session.Session(auth=auth))
def list_volume(c_client):
print c_client.volumes.list()
print "list_volume_id:: ", list_volume(_get_client())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment