Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Batch] Fix #23445: az batch pool supported-images list: Fix the NoneType object has no attribute startswith bug for getting supported images list #23449

Merged
merged 8 commits into from
Aug 9, 2022
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://')):
wangzelin007 marked this conversation as resolved.
Show resolved Hide resolved
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