Guest User

Untitled

a guest
Jul 31st, 2017
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. from keystoneauth1 import loading
  2. from keystoneauth1 import session
  3. from heatclient import client
  4. from novaclient import client as nova_client
  5.  
  6. AUTH_URL = 'http://10.26.12.31:5000/v3'
  7. USERNAME = 'test'
  8. PASSWORD = 'test'
  9. PROJECT_NAME = 'test'
  10. USER_DOMAIN_NAME = 'Default'
  11. PROJECT_DOMAIN_NAME = 'Default'
  12.  
  13. loader = loading.get_plugin_loader('password')
  14. auth = loader.load_from_options(auth_url=AUTH_URL,
  15. username=USERNAME, project_domain_name=PROJECT_DOMAIN_NAME,
  16. password=PASSWORD, user_domain_name=USER_DOMAIN_NAME,
  17. project_name=PROJECT_NAME)
  18.  
  19. sess = session.Session(auth=auth)
  20. nova = nova_client.Client('2', session=sess)
  21.  
  22. # Works fine
  23. print nova.servers.list()
  24.  
  25. # keystoneauth1.exceptions.catalog.EndpointNotFound: Could not find requested endpoint in Service Catalog.
  26. heat = client.Client('1', session=sess)
  27. for stack in heat.stacks.list():
  28. print stack
Add Comment
Please, Sign In to add comment