Skip to content

Commit

Permalink
[ARM] Fix the exit code of az group deployment validate when the veri…
Browse files Browse the repository at this point in the history
…fication fails (#11842)
  • Loading branch information
zhoxing-ms authored and Juliehzl committed Jan 19, 2020
1 parent bd78e5f commit b1cf183
Show file tree
Hide file tree
Showing 6 changed files with 227 additions and 128 deletions.
1 change: 1 addition & 0 deletions src/azure-cli/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Release History
**ARM**

* Fix issue #11658: `az group export` command does not support `--query` and `--output` parameters
* Fix issue #10279: The exit code of `az group deployment validate` is 0 when the verification fails

**IoT Central**

Expand Down
5 changes: 4 additions & 1 deletion src/azure-cli/azure/cli/command_modules/resource/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ def _deploy_arm_template_core(cli_ctx, resource_group_name,

smc = get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, aux_subscriptions=aux_subscriptions)
if validate_only:
return sdk_no_wait(no_wait, smc.deployments.validate, resource_group_name, deployment_name, properties)
response = sdk_no_wait(no_wait, smc.deployments.validate, resource_group_name, deployment_name, properties)
if response and response.error:
raise CLIError(response.error)
return response
return sdk_no_wait(no_wait, smc.deployments.create_or_update, resource_group_name, deployment_name, properties)


Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit b1cf183

Please sign in to comment.