Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 3d191c3

Browse files
authored
use deploy logging context for app creation logs (#952)
1 parent 60ae07c commit 3d191c3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/deployment/deploy.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def try_sp_create() -> None:
347347
not in str(err)
348348
):
349349
raise err
350-
logging.warning(
350+
logger.warning(
351351
"creating service principal failed with an error that occurs "
352352
"due to AAD race conditions"
353353
)
@@ -533,7 +533,7 @@ def deploy_template(self) -> None:
533533
"PrincipalNotFound" in as_repr
534534
and "does not exist in the directory" in as_repr
535535
):
536-
logging.info("application principal not available in AAD yet")
536+
logger.info("application principal not available in AAD yet")
537537
if error:
538538
raise error
539539
else:

src/deployment/registration.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ def add_application_password(
252252
while count < tries:
253253
count += 1
254254
if count > 1:
255-
logging.info("retrying app password creation")
255+
logger.info("retrying app password creation")
256256
try:
257257
password = add_application_password_impl(app_object_id, subscription_id)
258-
logging.info("app password created")
258+
logger.info("app password created")
259259
return password
260260
except GraphQueryError as err:
261261
error = err
@@ -265,9 +265,9 @@ def add_application_password(
265265
# azure/cli/command_modules/util/tests/
266266
# latest/test_rest.py#L191-L192
267267
if "Request_ResourceNotFound" in repr(err):
268-
logging.info("app unavailable in AAD, unable to create password yet")
268+
logger.info("app unavailable in AAD, unable to create password yet")
269269
else:
270-
logging.warning("unable to create app password: %s", err.message)
270+
logger.warning("unable to create app password: %s", err.message)
271271
time.sleep(wait_duration)
272272
if error:
273273
raise error

0 commit comments

Comments
 (0)