Change Heat and Glance client to use internal endpoint
Change-Id: I8267edfb6b10b0f7360c0464ebca8f97db41045e
This commit is contained in:
parent
7a99462270
commit
e8b268c21b
@ -45,7 +45,11 @@ SERVICE_OPTS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
cfg.CONF.register_opts(SERVICE_OPTS, OPT_GROUP)
|
cfg.CONF.register_opts(SERVICE_OPTS, OPT_GROUP)
|
||||||
CONF = cfg.CONF.keystone_authtoken
|
cfg.CONF.register_opts([
|
||||||
|
cfg.StrOpt('glance_api_url', default=None, help="glance api internal url")
|
||||||
|
])
|
||||||
|
|
||||||
|
CONF = cfg.CONF
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -99,13 +103,13 @@ class Clients(object):
|
|||||||
def keystone(self):
|
def keystone(self):
|
||||||
"""Returns keystone Client."""
|
"""Returns keystone Client."""
|
||||||
params = {
|
params = {
|
||||||
'username': CONF.username,
|
'username': CONF.keystone_authtoken.username,
|
||||||
'password': CONF.password,
|
'password': CONF.keystone_authtoken.password,
|
||||||
'auth_url': CONF.auth_url,
|
'auth_url': CONF.keystone_authtoken.auth_url,
|
||||||
'project_name': CONF.project_name,
|
'project_name': CONF.keystone_authtoken.project_name,
|
||||||
'user_domain_name': CONF.user_domain_name,
|
'user_domain_name': CONF.keystone_authtoken.user_domain_name,
|
||||||
'project_domain_name': CONF.project_domain_name,
|
'project_domain_name': CONF.keystone_authtoken.project_domain_name,
|
||||||
'https_cacert': CONF.https_cacert
|
'https_cacert': CONF.keystone_authtoken.https_cacert
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
client = create_keystone_client(params)
|
client = create_keystone_client(params)
|
||||||
@ -128,13 +132,13 @@ class Clients(object):
|
|||||||
while attempt >= 0:
|
while attempt >= 0:
|
||||||
try:
|
try:
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'auth_url': CONF.auth_url,
|
'auth_url': CONF.keystone_authtoken.auth_url,
|
||||||
'session': kc.session,
|
'session': kc.session,
|
||||||
'auth': kc.session.auth,
|
'auth': kc.session.auth,
|
||||||
'service_type': 'orchestration',
|
'service_type': 'orchestration',
|
||||||
'endpoint_type': 'publicURL',
|
'endpoint_type': 'internalURL',
|
||||||
'username': CONF.username,
|
'username': CONF.keystone_authtoken.username,
|
||||||
'password': CONF.password,
|
'password': CONF.keystone_authtoken.password,
|
||||||
'include_pass': 'False',
|
'include_pass': 'False',
|
||||||
'endpoint_override': '',
|
'endpoint_override': '',
|
||||||
}
|
}
|
||||||
@ -162,7 +166,9 @@ class Clients(object):
|
|||||||
attempt = 1
|
attempt = 1
|
||||||
while attempt >= 0:
|
while attempt >= 0:
|
||||||
try:
|
try:
|
||||||
return glance.Client(version, session=kc.session)
|
return glance.Client(version=version,
|
||||||
|
session=kc.session,
|
||||||
|
endpoint=CONF.glance_api_url)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
try:
|
try:
|
||||||
kc = self.keystone()
|
kc = self.keystone()
|
||||||
|
@ -63,6 +63,8 @@ default_opts = [
|
|||||||
help="Max allotment of tries for resource creation"),
|
help="Max allotment of tries for resource creation"),
|
||||||
cfg.StrOpt('transport_url', default='',
|
cfg.StrOpt('transport_url', default='',
|
||||||
help="Messaging queue url", secret=True),
|
help="Messaging queue url", secret=True),
|
||||||
|
cfg.StrOpt('glance_api_url', default=None,
|
||||||
|
help="glance api internal url"),
|
||||||
cfg.StrOpt('use_stderr', default='true', help=""),
|
cfg.StrOpt('use_stderr', default='true', help=""),
|
||||||
cfg.StrOpt('verbose', default='false', help=""),
|
cfg.StrOpt('verbose', default='false', help=""),
|
||||||
cfg.BoolOpt('enable_rds_callback_check',
|
cfg.BoolOpt('enable_rds_callback_check',
|
||||||
|
Loading…
Reference in New Issue
Block a user