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

[ARM] az provider register: Make parameter --accept-term become not required #18509

Merged
merged 2 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/azure-cli/azure/cli/command_modules/resource/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,9 +1025,7 @@ def _update_provider(cli_ctx, namespace, registering, wait, mg_id=None, accept_t
rcf = _resource_client_factory(cli_ctx)
is_rpaas = namespace.lower() in RPAAS_APIS
if mg_id is None and registering:
if is_rpaas:
if not accept_terms:
raise RequiredArgumentMissingError("--accept-terms must be specified when registering the {} RP from RPaaS.".format(namespace))
if is_rpaas and accept_terms:
wait = True
r = rcf.providers.register(namespace)
elif mg_id and registering:
Expand All @@ -1046,7 +1044,7 @@ def _update_provider(cli_ctx, namespace, registering, wait, mg_id=None, accept_t
rp_info = rcf.providers.get(namespace)
if rp_info.registration_state == target_state:
break
if is_rpaas and registering and mg_id is None:
if is_rpaas and accept_terms and registering and mg_id is None:
# call accept term API
from azure.cli.core.util import send_raw_request
send_raw_request(cli_ctx, 'put', RPAAS_APIS[namespace.lower()], body=json.dumps({"properties": {"accepted": True}}))
Expand Down
Loading