-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
Sys.exit(3) is called when a resource is not found, and since azure-cli is also a python pip package that can be used as an API in python programs, I can't handle this exception myself because the program just exits. I would recommend not doing the sys.exit(3) and allowing exception handling.
| sys.exit(3) |
Related command
az container show
Errors
ERROR:cli.azure.cli.core.azclierror:(ResourceNotFound) The Resource 'Microsoft.ContainerInstance/containerGroups/xxxxxxxx' under resource group 'xxxxxx' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Issue script & Debug output
ERROR:cli.azure.cli.core.azclierror:(ResourceNotFound) The Resource 'Microsoft.ContainerInstance/containerGroups/xxxxxxxx' under resource group 'xxxxxx' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
The arm requests are not logged even in --debug mode, Maybe this is because of the systemexit()? I get the non-debug output as shown above, but no ARM requests. I'm sure about this because my program executes other az cli commands that all show ARM requests being logged, except for this call to az container show.
Expected behavior
Raising an exception
Environment Summary
azure-cli 2.67.0
azure-cli-core 2.67.0
Additional context
No response