From ac5ce2f325578858e8bcf37df39e82382d2b96fd Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 3 Nov 2020 11:48:54 -0800 Subject: [PATCH] adding a logging message to warn about create_basic_client and use get_cred/create from cred --- tools/azure-sdk-tools/devtools_testutils/azure_testcase.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/azure-sdk-tools/devtools_testutils/azure_testcase.py b/tools/azure-sdk-tools/devtools_testutils/azure_testcase.py index 0036de94bf13..55c56ab4e231 100644 --- a/tools/azure-sdk-tools/devtools_testutils/azure_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/azure_testcase.py @@ -5,6 +5,7 @@ #-------------------------------------------------------------------------- import functools import inspect +import logging import os.path import sys import zlib @@ -258,6 +259,12 @@ def create_client_from_credential(self, client_class, credential, **kwargs): def create_basic_client(self, client_class, **kwargs): """ DO NOT USE ME ANYMORE.""" + logger = logging.getLogger().setLevel(logging.WARNING) + logger.warn( + "'create_basic_client' will be deprecated in the future. It is recommended that you use \ + 'get_credential' and 'create_client_from_credential' to create your client." + ) + credentials = self.get_credential(client_class) return self.create_client_from_credential(client_class, credentials, **kwargs)