use clouds.yaml instead for the auth params
This commit is contained in:
parent
af0d2be35c
commit
d26633b37e
@ -2,21 +2,17 @@
|
||||
|
||||
import os
|
||||
import requests
|
||||
import yaml
|
||||
|
||||
from novaclient.client import Client as nova_auth
|
||||
from keystoneclient.v3.client import Client as keystone_auth
|
||||
|
||||
def get_credentials():
|
||||
cred = {}
|
||||
cred['version'] = '2'
|
||||
cred['username'] = "admin"
|
||||
cred['password'] = "openstack"
|
||||
cred['auth_url'] = "http://10.0.1.216:5000/v3"
|
||||
cred['project_name'] = "admin"
|
||||
cred['user_domain_name'] = "admin_domain"
|
||||
cred['project_domain_name'] = "admin_domain"
|
||||
with open('/home/arif/clouds.yaml','r') as stream:
|
||||
creds = yaml.safe_load(stream)['clouds']['arif-home']['auth']
|
||||
|
||||
return cred
|
||||
creds['version'] = '2'
|
||||
return creds
|
||||
|
||||
def get_auth_token():
|
||||
creds = get_credentials()
|
||||
|
Loading…
Reference in New Issue
Block a user