Skip to content

Commit

Permalink
fix: curate_auth func changed to non-async
Browse files Browse the repository at this point in the history
await call for _curate_auth_url missing in session
creation which caused regression.
function _curate_auth_url changed to non-async,
tests updated to reflect the same

Signed-off-by: Kaleemullah Siddiqui <[email protected]>
  • Loading branch information
kaleemsiddiqu committed Nov 3, 2023
1 parent 859d911 commit 583193a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mrack/providers/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async def _openstack_gather_responses(self, *calls):

return result

async def _curate_auth_url(self, auth_url):
def _curate_auth_url(self, auth_url):
"""Append OpenStack API version if not present."""
return auth_url if auth_url.endswith("/v3") else auth_url + "/v3"

Expand Down
5 changes: 2 additions & 3 deletions tests/unit/test_openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,7 @@ async def test_create_session_from_clouds_yaml(
("http://example.com/openstack/v3", "http://example.com/openstack/v3"),
],
)
@pytest.mark.asyncio
async def test_curate_auth_url(self, input_auth_url, expected_auth_url):
def test_curate_auth_url(self, input_auth_url, expected_auth_url):
provider = OpenStackProvider()
result_auth_url = await provider._curate_auth_url(input_auth_url)
result_auth_url = provider._curate_auth_url(input_auth_url)
assert result_auth_url == expected_auth_url

0 comments on commit 583193a

Please sign in to comment.