Fixed public endpoints settings, and requirements
Related-PROD: PROD-36943
Change-Id: I516e0503164c6deaf78af4a7e5182e624cfc3ba8
diff --git a/utils/__init__.py b/utils/__init__.py
index 155c03f..6d3f948 100644
--- a/utils/__init__.py
+++ b/utils/__init__.py
@@ -37,7 +37,10 @@
project_name=os.environ['OS_PROJECT_NAME'],
auth_url=os.environ['OS_AUTH_URL'],
cert=False,
- domain=os.environ['OS_PROJECT_DOMAIN_NAME']
+ domain=os.environ['OS_PROJECT_DOMAIN_NAME'],
+ endpoint_type=os.environ["OS_ENDPOINT_TYPE"],
+ interface=os.environ["OS_ENDPOINT_TYPE"],
+
)
os_actions = os_client.OSCliActions(openstack_clients)
nova_computes = os_actions.list_nova_computes()
diff --git a/utils/os_client.py b/utils/os_client.py
index 7febc30..d00e662 100644
--- a/utils/os_client.py
+++ b/utils/os_client.py
@@ -34,6 +34,7 @@
def __init__(self, username=None, password=None,
project_name=None, auth_url=None, endpoint_type="internalURL",
+ interface=INTERFACE,
cert=False, domain="Default", **kwargs):
self.traceback = ""
@@ -51,6 +52,7 @@
self.endpoint_type = endpoint_type
self.cert = cert
self.domain = domain
+ self.interface = interface
self.kwargs = kwargs
# Lazy clients
@@ -101,7 +103,7 @@
@classmethod
def get_auth_client(cls, username=None, password=None,
project_name=None, auth_url=None, cert=None,
- domain='Default', **kwargs):
+ domain='Default', os_interface=None, **kwargs):
session = cls._get_auth_session(
username=username,
password=password,
@@ -109,8 +111,11 @@
auth_url=auth_url,
cert=cert,
domain=domain)
+ endpoint_filter = {"interface": os_interface}
keystone = keystone_client.Client(version=cls.KEYSTONECLIENT_VERSION,
- session=session, **kwargs)
+ session=session, **kwargs,
+ interface=os_interface,
+ endpoint_filter=endpoint_filter)
keystone.management_url = auth_url
return keystone
@@ -172,7 +177,8 @@
if self._auth is None:
self._auth = self.get_auth_client(
self.username, self.password, self.project_name, self.auth_url,
- self.cert, self.domain, endpoint_type=self.endpoint_type
+ self.cert, self.domain, endpoint_type=self.endpoint_type,
+ os_interface=self.interface
)
return self._auth