Skip to content

Commit 51e3e7b

Browse files
authored
Merge branch 'release-2018-11-06' into november
2 parents 4b5e1a0 + 43cad7e commit 51e3e7b

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/ResourceManager/Compute/Commands.Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
## Current Release
2222
* Add Add-AzureRmVmssVMDataDisk and Remove-AzureRmVmssVMDataDisk cmdlets
2323
* Get-AzureRmVMImage shows AutomaticOSUpgradeProperties
24+
* Fixed SetAzureRmVMChefExtension -BootstrapOptions and -JsonAttribute option values are not setting in json format.
2425

2526
## Version 5.7.2
2627
* Add EnableUltraSSD switch parameter to New-AzureRmVMConfiig and New-AzureRmVmssConfig.

src/ResourceManager/Compute/Commands.Compute/Extension/Chef/SetAzureVMChefExtension.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using System.IO;
2323
using System.Linq;
2424
using System.Management.Automation;
25+
using Newtonsoft.Json.Linq;
2526

2627
namespace Microsoft.Azure.Commands.Compute.Extension.Chef
2728
{
@@ -257,6 +258,7 @@ private Hashtable PublicConfiguration
257258
bool IsBootstrapOptionsEmpty = string.IsNullOrEmpty(this.BootstrapOptions);
258259
bool IsJsonAttributeEmpty = string.IsNullOrEmpty(this.JsonAttribute);
259260
bool IsChefDaemonIntervalEmpty = string.IsNullOrEmpty(this.ChefDaemonInterval);
261+
bool IsBootstrapVersionEmpty = string.IsNullOrEmpty(this.BootstrapVersion);
260262
string BootstrapVersion = string.IsNullOrEmpty(this.BootstrapVersion) ? "" : this.BootstrapVersion;
261263
bool IsDaemonEmpty = string.IsNullOrEmpty(this.Daemon);
262264

@@ -308,7 +310,10 @@ private Hashtable PublicConfiguration
308310
}
309311

310312
var hashTable = new Hashtable();
311-
hashTable.Add(BootstrapVersionTemplate, BootstrapVersion);
313+
if (!IsBootstrapVersionEmpty)
314+
{
315+
hashTable.Add(BootstrapVersionTemplate, BootstrapVersion);
316+
}
312317
hashTable.Add(ClientRbTemplate, ClientConfig);
313318

314319
if (!IsRunListEmpty)
@@ -318,12 +323,14 @@ private Hashtable PublicConfiguration
318323

319324
if (!IsBootstrapOptionsEmpty)
320325
{
321-
hashTable.Add(BootStrapOptionsTemplate, this.BootstrapOptions);
326+
JObject bootstrap_option_json = JObject.Parse(this.BootstrapOptions);
327+
hashTable.Add(BootStrapOptionsTemplate, bootstrap_option_json);
322328
}
323329

324330
if (!IsJsonAttributeEmpty)
325331
{
326-
hashTable.Add(JsonAttributeTemplate, JsonAttribute);
332+
JObject json_attribute_json = JObject.Parse(this.JsonAttribute);
333+
hashTable.Add(JsonAttributeTemplate, json_attribute_json);
327334
}
328335

329336
if (!IsChefDaemonIntervalEmpty)
@@ -336,6 +343,7 @@ private Hashtable PublicConfiguration
336343
hashTable.Add(DaemonTemplate, this.Daemon);
337344
}
338345

346+
339347
this.publicConfiguration = hashTable;
340348
}
341349

0 commit comments

Comments
 (0)