From b3da8adffdf21156be95dc0a00992d492508970e Mon Sep 17 00:00:00 2001 From: Uday Kurundwade Date: Thu, 7 Dec 2023 20:52:52 +0530 Subject: [PATCH] Fixes ClientSecretCredential token issue Signed-off-by: Uday Kurundwade --- tests/manage/mcg/test_azure_noobaa_sa.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/manage/mcg/test_azure_noobaa_sa.py b/tests/manage/mcg/test_azure_noobaa_sa.py index 1f7e9c403a8..86014f88bef 100644 --- a/tests/manage/mcg/test_azure_noobaa_sa.py +++ b/tests/manage/mcg/test_azure_noobaa_sa.py @@ -40,7 +40,9 @@ def test_tls_version_and_secure_transfer( """ azure_depl = AZUREIPI() - token = azure_depl.azure_util.credentials.token["access_token"] + tkn = azure_depl.azure_util.credentials.get_token( + "https://management.azure.com/.default" + ) secret_ocp_obj = OCP( kind=constants.SECRET, namespace=config.ENV_DATA["cluster_namespace"] ) @@ -54,7 +56,7 @@ def test_tls_version_and_secure_transfer( subscription_id = base64.b64decode( creds_secret_obj.get("data").get("azure_subscription_id") ).decode("utf-8") - headers = {"Authorization": f"Bearer {token}"} + headers = {"Authorization": f"Bearer {tkn.token}"} url = ( f"https://management.azure.com/subscriptions/{subscription_id}/" f"resourceGroups/{resource_group_name}/providers/Microsoft.Storage/"