Advertisement
Guest User

Keystone authentication openstack keystone

a guest
Mar 13th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. import os
  2.  
  3. from keystoneauth1 import session
  4. from keystoneauth1.extras.kerberos import MappedKerberos
  5. from novaclient import client
  6.  
  7. auth = MappedKerberos(auth_url=os.environ.get('OS_AUTH_URL'),
  8.                       project_id=os.environ.get('OS_PROJECT_ID'),
  9.                       project_domain_id=os.environ.get('OS_PROJECT_DOMAIN_ID'),
  10.                       identity_provider=os.environ.get('OS_IDENTITY_PROVIDER'),
  11.                       protocol=os.environ.get('OS_PROTOCOL'),
  12.                       mutual_auth=os.environ.get('OS_MUTUAL_AUTH'))
  13.  
  14. sess = session.Session(auth=auth)
  15. nova = client.Client('2', session=sess)
  16. nova.servers.list()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement