Skip to content

Commit 74530c4

Browse files
committed
Merge pull request #1440 from ClogenyTechnologies/nim/add_bootstrap_version_option
Added bootstrap_version option
2 parents 005fdc9 + e1c4759 commit 74530c4

File tree

3 files changed

+44
-9
lines changed

3 files changed

+44
-9
lines changed

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Chef/SetAzureVMChefExtension.cs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineChefExtensionCmdletB
9696
[ValidateNotNullOrEmpty]
9797
public SwitchParameter DeleteChefConfig { get; set; }
9898

99+
[Parameter(
100+
ValueFromPipelineByPropertyName = true,
101+
HelpMessage = "Chef client version to be installed with the extension")]
102+
[ValidateNotNullOrEmpty]
103+
public string BootstrapVersion { get; set; }
104+
99105
[Parameter(
100106
Mandatory = true,
101107
ParameterSetName = LinuxParameterSetName,
@@ -167,6 +173,7 @@ private void SetPublicConfig()
167173
bool IsBootstrapOptionsEmpty = string.IsNullOrEmpty(this.BootstrapOptions);
168174
string AutoUpdateChefClient = this.AutoUpdateChefClient.IsPresent ? "true" : "false";
169175
string DeleteChefConfig = this.DeleteChefConfig.IsPresent ? "true" : "false";
176+
string BootstrapVersion = this.BootstrapVersion;
170177

171178
//Cases handled:
172179
// 1. When clientRb given by user and:
@@ -220,41 +227,44 @@ private void SetPublicConfig()
220227
{
221228
if (IsBootstrapOptionsEmpty)
222229
{
223-
this.PublicConfiguration = string.Format("{{{0},{1},{2}}}",
230+
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3}}}",
224231
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
225232
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
226-
string.Format(ClientRbTemplate, ClientConfig));
233+
string.Format(ClientRbTemplate, ClientConfig),
234+
string.Format(BootstrapVersionTemplate, BootstrapVersion));
227235
}
228236
else
229237
{
230-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3}}}",
238+
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
231239
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
232240
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
233241
string.Format(ClientRbTemplate, ClientConfig),
234-
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions));
242+
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
243+
string.Format(BootstrapVersionTemplate, BootstrapVersion));
235244
}
236245
}
237246
else
238247
{
239248
if (IsBootstrapOptionsEmpty)
240249
{
241-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3}}}",
250+
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
242251
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
243252
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
244253
string.Format(ClientRbTemplate, ClientConfig),
245-
string.Format(RunListTemplate, this.RunList));
254+
string.Format(RunListTemplate, this.RunList),
255+
string.Format(BootstrapVersionTemplate, BootstrapVersion));
246256
}
247257
else
248258
{
249-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
259+
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
250260
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
251261
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
252262
string.Format(ClientRbTemplate, ClientConfig),
253263
string.Format(RunListTemplate, this.RunList),
254-
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions));
264+
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
265+
string.Format(BootstrapVersionTemplate, BootstrapVersion));
255266
}
256267
}
257-
258268
}
259269

260270
protected override void ValidateParameters()

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Chef/VirtualMachineChefExtensionCmdletBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class VirtualMachineChefExtensionCmdletBase : VirtualMachineExtensionCmdl
2525
protected const string AutoUpdateTemplate = "\"autoUpdateClient\":\"{0}\"";
2626
protected const string DeleteChefConfigTemplate = "\"deleteChefConfig\":\"{0}\"";
2727
protected const string ClientRbTemplate = "\"client_rb\":\"{0}\"";
28+
protected const string BootstrapVersionTemplate = "\"bootstrap_version\":\"{0}\"";
2829
protected const string BootStrapOptionsTemplate = "\"bootstrap_options\":{0}";
2930
protected const string RunListTemplate = "\"runlist\": \"\\\"{0}\\\"\"";
3031

src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35125,6 +35125,12 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
3512535125
<maml:para>Indicates that this cmdlet deletes the Chef configuration on the virtual machine.</maml:para>
3512635126
</maml:description>
3512735127
</command:parameter>
35128+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
35129+
<maml:name>BootstrapVersion</maml:name>
35130+
<maml:description>
35131+
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
35132+
</maml:description>
35133+
</command:parameter>
3512835134
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
3512935135
<maml:name>OrganizationName</maml:name>
3513035136
<maml:description>
@@ -35214,6 +35220,12 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
3521435220
<maml:para>Indicates that this cmdlet deletes the Chef configuration on the virtual machine.</maml:para>
3521535221
</maml:description>
3521635222
</command:parameter>
35223+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
35224+
<maml:name>BootstrapVersion</maml:name>
35225+
<maml:description>
35226+
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
35227+
</maml:description>
35228+
</command:parameter>
3521735229
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
3521835230
<maml:name>OrganizationName</maml:name>
3521935231
<maml:description>
@@ -35330,6 +35342,18 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
3533035342
</dev:type>
3533135343
<dev:defaultValue>none</dev:defaultValue>
3533235344
</command:parameter>
35345+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
35346+
<maml:name>BootstrapVersion</maml:name>
35347+
<maml:description>
35348+
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
35349+
</maml:description>
35350+
<command:parameterValue required="false" variableLength="false">String</command:parameterValue>
35351+
<dev:type>
35352+
<maml:name>String</maml:name>
35353+
<maml:uri />
35354+
</dev:type>
35355+
<dev:defaultValue>none</dev:defaultValue>
35356+
</command:parameter>
3533335357
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
3533435358
<maml:name>Linux</maml:name>
3533535359
<maml:description>

0 commit comments

Comments
 (0)