Skip to content

Commit

Permalink
adding a logging message to warn about create_basic_client and use ge…
Browse files Browse the repository at this point in the history
…t_cred/create from cred
  • Loading branch information
seankane-msft committed Nov 3, 2020
1 parent 208b6a3 commit ac5ce2f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/azure-sdk-tools/devtools_testutils/azure_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#--------------------------------------------------------------------------
import functools
import inspect
import logging
import os.path
import sys
import zlib
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit ac5ce2f

Please sign in to comment.