Update ranger-agent

Change-Id: Ie0cd82023eaba78c11cc7a59d6b23c4d7cd944f7
This commit is contained in:
st6218 2018-12-17 08:55:46 -08:00 committed by Hari
parent 3935196db1
commit fe41f3f500
1 changed files with 26 additions and 18 deletions

View File

@ -14,8 +14,8 @@
from glanceclient import client as glance
from heatclient import client as heat
from keystoneclient.auth.identity import v3
from keystoneclient import session as ksc_session
from keystoneauth1.identity import v3
from keystoneauth1 import session as ksc_session
from keystoneclient.v3 import client as keystone_v3
from oslo_config import cfg
@ -122,14 +122,18 @@ class Clients(object):
attempt = 1
while attempt >= 0:
try:
heat_api_url = kc.session.get_endpoint(
service_type='orchestration')
auth_token = kc.auth_token
client = heat.Client(version,
endpoint=heat_api_url,
project_name=CONF.project_name,
cacert=CONF.https_cacert,
token=auth_token)
kwargs = {
'auth_url': CONF.auth_url,
'session': kc.session,
'auth': kc.session.auth,
'service_type': 'orchestration',
'endpoint_type': 'publicURL',
'username': CONF.username,
'password': CONF.password,
'include_pass': 'False',
'endpoint_override': '',
}
client = heat.Client(version, **kwargs)
return client, kc
except Exception as ex:
try:
@ -153,14 +157,18 @@ class Clients(object):
attempt = 1
while attempt >= 0:
try:
glance_api_url = kc.session.get_endpoint(
service_type='image')
auth_token = kc.auth_token
client = glance.Client(version,
endpoint=glance_api_url,
project_name=CONF.project_name,
token=auth_token,
cacert=CONF.https_cacert)
kwargs = {
'auth_url': CONF.auth_url,
'session': kc.session,
'auth': kc.session.auth,
'service_type': 'image',
'endpoint_type': 'publicURL',
'username': CONF.username,
'password': CONF.password,
'include_pass': 'False',
'endpoint_override': '',
}
client = glance.Client(version, **kwargs)
return client, kc
except Exception as ex:
try: