Skip to content

Commit

Permalink
[AzureRGDeploy] Sanitizing parameters bug fix (#6349)
Browse files Browse the repository at this point in the history
* [AzureRGDeploy] Sanitization bug fix

* Fixing getError

* Revert "Fixing getError"

This reverts commit 506497e.
  • Loading branch information
thesattiraju authored Feb 2, 2018
1 parent 7cde369 commit f89fa98
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Tasks/AzureResourceGroupDeployment/Tests/CSM.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"param": {
"value": 1,
"value": false,
"toBeRemoved": true
}
}
Expand Down
18 changes: 10 additions & 8 deletions Tasks/AzureResourceGroupDeployment/operations/ResourceGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,16 @@ export class ResourceGroup {
private sanitizeParameters(parameters: Map<string, ParameterValue>): Map<string, ParameterValue> {
var result: Map<string, ParameterValue> = {} as Map<string, ParameterValue>;
for (var key in parameters) {
if (!!parameters[key].value) {
result[key] = {
value: parameters[key].value
} as ParameterValue;
} else if (!!parameters[key].reference) {
result[key] = {
reference: parameters[key].reference
} as ParameterValue;
if (!!parameters[key]) {
if (parameters[key].hasOwnProperty("value")) {
result[key] = {
value: parameters[key].value
} as ParameterValue;
} else if (parameters[key].hasOwnProperty("reference")) {
result[key] = {
reference: parameters[key].reference
} as ParameterValue;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureResourceGroupDeployment/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 129,
"Patch": 3
"Patch": 4
},
"demands": [],
"minimumAgentVersion": "2.119.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureResourceGroupDeployment/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 129,
"Patch": 3
"Patch": 4
},
"demands": [],
"minimumAgentVersion": "2.119.1",
Expand Down

0 comments on commit f89fa98

Please sign in to comment.