Merge "Compute HA: Remove version discovery of keystone API"
This commit is contained in:
commit
6baeaa1d82
@ -72,25 +72,17 @@ def create_nova_connection(options):
|
||||
|
||||
from keystoneauth1 import loading
|
||||
from keystoneauth1 import session
|
||||
from keystoneclient import discover
|
||||
|
||||
# Prefer the oldest and strip the leading 'v'
|
||||
keystone_versions = discover.available_versions(options["auth_url"][0])
|
||||
keystone_version = keystone_versions[0]['id'][1:]
|
||||
kwargs = dict(
|
||||
auth_url=options["auth_url"][0],
|
||||
username=options["username"][0],
|
||||
password=options["password"][0]
|
||||
password=options["password"][0],
|
||||
project_name=options["project_name"][0],
|
||||
user_domain_name=options["user_domain_name"][0],
|
||||
project_domain_name=options["project_domain_name"][0],
|
||||
)
|
||||
|
||||
if discover.version_match("2", keystone_version):
|
||||
kwargs["tenant_name"] = options["tenant_name"][0]
|
||||
|
||||
elif discover.version_match("3", keystone_version):
|
||||
kwargs["project_name"] = options["project_name"][0]
|
||||
kwargs["user_domain_name"] = options["user_domain_name"][0]
|
||||
kwargs["project_domain_name"] = options["project_domain_name"][0]
|
||||
|
||||
loader = loading.get_plugin_loader('password')
|
||||
keystone_auth = loader.load_from_options(**kwargs)
|
||||
keystone_session = session.Session(auth=keystone_auth, verify=(not options["insecure"]))
|
||||
|
Loading…
Reference in New Issue
Block a user