Skip to content

Commit 39abf17

Browse files
authored
[Batch] Fix #23445: az batch pool supported-images list: Fix the NoneType object has no attribute startswith bug for getting supported images list (#23449)
1 parent eecae29 commit 39abf17

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/azure-cli/azure/cli/command_modules/batch/_validators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,10 @@ def validate_client_parameters(cmd, namespace):
304304
namespace.account_endpoint = cmd.cli_ctx.config.get('batch', 'endpoint', None)
305305

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

0 commit comments

Comments
 (0)