Skip to content

Commit aa6553a

Browse files
committed
Merge pull request #419 from Azure/dev
HPF PR: dev <- Azure:dev
2 parents fa796e6 + 92d6174 commit aa6553a

File tree

3 files changed

+44
-8
lines changed

3 files changed

+44
-8
lines changed

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

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineChefExtensionCmdletB
102102
[ValidateNotNullOrEmpty]
103103
public string BootstrapVersion { get; set; }
104104

105+
[Parameter(
106+
ValueFromPipelineByPropertyName = true,
107+
HelpMessage = "Uninstall Chef client during update/uninstall extension. Default is false.")]
108+
[ValidateNotNullOrEmpty]
109+
public SwitchParameter UninstallChefClient { get; set; }
110+
105111
[Parameter(
106112
Mandatory = true,
107113
ParameterSetName = LinuxParameterSetName,
@@ -174,6 +180,7 @@ private void SetPublicConfig()
174180
string AutoUpdateChefClient = this.AutoUpdateChefClient.IsPresent ? "true" : "false";
175181
string DeleteChefConfig = this.DeleteChefConfig.IsPresent ? "true" : "false";
176182
string BootstrapVersion = this.BootstrapVersion;
183+
string UninstallChefClient = this.UninstallChefClient.IsPresent ? "true" : "false";
177184

178185
//Cases handled:
179186
// 1. When clientRb given by user and:
@@ -227,42 +234,46 @@ private void SetPublicConfig()
227234
{
228235
if (IsBootstrapOptionsEmpty)
229236
{
230-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3}}}",
237+
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
231238
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
232239
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
233240
string.Format(ClientRbTemplate, ClientConfig),
234-
string.Format(BootstrapVersionTemplate, BootstrapVersion));
241+
string.Format(BootstrapVersionTemplate, BootstrapVersion),
242+
string.Format(UninstallChefClientTemplate, UninstallChefClient));
235243
}
236244
else
237245
{
238-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
246+
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
239247
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
240248
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
241249
string.Format(ClientRbTemplate, ClientConfig),
242250
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
243-
string.Format(BootstrapVersionTemplate, BootstrapVersion));
251+
string.Format(BootstrapVersionTemplate, BootstrapVersion),
252+
string.Format(UninstallChefClientTemplate, UninstallChefClient));
244253
}
245254
}
246255
else
247256
{
248257
if (IsBootstrapOptionsEmpty)
249258
{
250-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
259+
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
251260
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
252261
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
253262
string.Format(ClientRbTemplate, ClientConfig),
254263
string.Format(RunListTemplate, this.RunList),
255-
string.Format(BootstrapVersionTemplate, BootstrapVersion));
264+
string.Format(BootstrapVersionTemplate, BootstrapVersion),
265+
string.Format(UninstallChefClientTemplate, UninstallChefClient));
256266
}
257267
else
258268
{
259-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
269+
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5},{6}}}",
260270
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
261271
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
262272
string.Format(ClientRbTemplate, ClientConfig),
263273
string.Format(RunListTemplate, this.RunList),
264274
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
265-
string.Format(BootstrapVersionTemplate, BootstrapVersion));
275+
string.Format(BootstrapVersionTemplate, BootstrapVersion),
276+
string.Format(UninstallChefClientTemplate, UninstallChefClient));
266277
}
267278
}
268279
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class VirtualMachineChefExtensionCmdletBase : VirtualMachineExtensionCmdl
2626
protected const string DeleteChefConfigTemplate = "\"deleteChefConfig\":\"{0}\"";
2727
protected const string ClientRbTemplate = "\"client_rb\":\"{0}\"";
2828
protected const string BootstrapVersionTemplate = "\"bootstrap_version\":\"{0}\"";
29+
protected const string UninstallChefClientTemplate = "\"uninstallChefClient\":\"{0}\"";
2930
protected const string BootStrapOptionsTemplate = "\"bootstrap_options\":{0}";
3031
protected const string RunListTemplate = "\"runlist\": \"\\\"{0}\\\"\"";
3132

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
@@ -35131,6 +35131,12 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
3513135131
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
3513235132
</maml:description>
3513335133
</command:parameter>
35134+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
35135+
<maml:name>UninstallChefClient</maml:name>
35136+
<maml:description>
35137+
<maml:para>Indicates that this cmdlet uninstalls the Chef Client on the vitual machine.</maml:para>
35138+
</maml:description>
35139+
</command:parameter>
3513435140
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
3513535141
<maml:name>OrganizationName</maml:name>
3513635142
<maml:description>
@@ -35226,6 +35232,12 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
3522635232
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
3522735233
</maml:description>
3522835234
</command:parameter>
35235+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
35236+
<maml:name>UninstallChefClient</maml:name>
35237+
<maml:description>
35238+
<maml:para>Indicates that this cmdlet uninstalls the Chef Client on the vitual machine.</maml:para>
35239+
</maml:description>
35240+
</command:parameter>
3522935241
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
3523035242
<maml:name>OrganizationName</maml:name>
3523135243
<maml:description>
@@ -35354,6 +35366,18 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
3535435366
</dev:type>
3535535367
<dev:defaultValue>none</dev:defaultValue>
3535635368
</command:parameter>
35369+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
35370+
<maml:name>UninstallChefClient</maml:name>
35371+
<maml:description>
35372+
<maml:para>Indicates that this cmdlet uninstalls the Chef Client on the vitual machine.</maml:para>
35373+
</maml:description>
35374+
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
35375+
<dev:type>
35376+
<maml:name>SwitchParameter</maml:name>
35377+
<maml:uri />
35378+
</dev:type>
35379+
<dev:defaultValue>none</dev:defaultValue>
35380+
</command:parameter>
3535735381
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
3535835382
<maml:name>Linux</maml:name>
3535935383
<maml:description>

0 commit comments

Comments
 (0)