Skip to content

Commit 506c8b1

Browse files
authored
Merge pull request #1293 from gboutry/fix/wait-all-endpoints
Allow passing service_codes to wait_for_all_endpoints
2 parents af5bea7 + 7a84324 commit 506c8b1

File tree

1 file changed

+7
-4
lines changed
  • zaza/openstack/charm_tests/keystone

1 file changed

+7
-4
lines changed

zaza/openstack/charm_tests/keystone/setup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,22 +170,25 @@ def add_tempest_roles():
170170
_add_additional_roles(TEMPEST_ROLES)
171171

172172

173-
def wait_for_all_endpoints(interface='public'):
173+
def wait_for_all_endpoints(interface='public', service_codes=None):
174174
"""Check all endpoints are returning an acceptable return code.
175175
176176
:param interface: Endpoint type to check. public, admin or internal
177177
:type interface: str
178+
:param service_codes: Dict of service names and acceptable return codes
179+
:type service_codes: Optional[dict]
178180
:raises: AssertionError
179181
"""
182+
if service_codes is None:
183+
service_codes = {}
180184
keystone_client = openstack_utils.get_keystone_overcloud_session_client()
181185
for service in keystone_client.services.list():
182186
for ep in keystone_client.endpoints.list(service=service,
183187
interface=interface):
184188
openstack_utils.wait_for_url(
185189
ep.url,
186-
# Heat cloudformation and orchestration return 400 and 401
187190
[
188191
requests.codes.ok,
189192
requests.codes.multiple_choices,
190-
requests.codes.bad_request,
191-
requests.codes.unauthorized])
193+
requests.codes.unauthorized,
194+
] + service_codes.get(service.name, []))

0 commit comments

Comments
 (0)