Skip to content

Commit

Permalink
[Batch] Fix Azure#23445: az batch pool supported-images list: Fix t…
Browse files Browse the repository at this point in the history
…he `NoneType object has no attribute startswith` bug for getting supported images list (Azure#23449)
  • Loading branch information
navba-MSFT authored Aug 9, 2022
1 parent eecae29 commit 39abf17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/azure-cli/azure/cli/command_modules/batch/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ def validate_client_parameters(cmd, namespace):
namespace.account_endpoint = cmd.cli_ctx.config.get('batch', 'endpoint', None)

# Simple validation for account_endpoint
if not (namespace.account_endpoint.startswith('https://') or
namespace.account_endpoint.startswith('http://')):
if namespace.account_endpoint and not (namespace.account_endpoint.startswith('https://') or
namespace.account_endpoint.startswith('http://')):
namespace.account_endpoint = 'https://' + namespace.account_endpoint
namespace.account_endpoint = namespace.account_endpoint.rstrip('/')
namespace.account_endpoint = namespace.account_endpoint.rstrip('/')
# if account name is specified but no key, attempt to query if we use shared key auth
if namespace.account_name and namespace.account_endpoint and not namespace.account_key:
if cmd.cli_ctx.config.get('batch', 'auth_mode', 'shared_key') == 'shared_key':
Expand Down

0 comments on commit 39abf17

Please sign in to comment.