Skip to content

HPF PR: dev <- Azure:dev #419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineChefExtensionCmdletB
[ValidateNotNullOrEmpty]
public string BootstrapVersion { get; set; }

[Parameter(
ValueFromPipelineByPropertyName = true,
HelpMessage = "Uninstall Chef client during update/uninstall extension. Default is false.")]
[ValidateNotNullOrEmpty]
public SwitchParameter UninstallChefClient { get; set; }

[Parameter(
Mandatory = true,
ParameterSetName = LinuxParameterSetName,
Expand Down Expand Up @@ -174,6 +180,7 @@ private void SetPublicConfig()
string AutoUpdateChefClient = this.AutoUpdateChefClient.IsPresent ? "true" : "false";
string DeleteChefConfig = this.DeleteChefConfig.IsPresent ? "true" : "false";
string BootstrapVersion = this.BootstrapVersion;
string UninstallChefClient = this.UninstallChefClient.IsPresent ? "true" : "false";

//Cases handled:
// 1. When clientRb given by user and:
Expand Down Expand Up @@ -227,42 +234,46 @@ private void SetPublicConfig()
{
if (IsBootstrapOptionsEmpty)
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
string.Format(BootstrapVersionTemplate, BootstrapVersion),
string.Format(UninstallChefClientTemplate, UninstallChefClient));
}
else
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
string.Format(BootstrapVersionTemplate, BootstrapVersion),
string.Format(UninstallChefClientTemplate, UninstallChefClient));
}
}
else
{
if (IsBootstrapOptionsEmpty)
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(RunListTemplate, this.RunList),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
string.Format(BootstrapVersionTemplate, BootstrapVersion),
string.Format(UninstallChefClientTemplate, UninstallChefClient));
}
else
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5},{6}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(RunListTemplate, this.RunList),
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
string.Format(BootstrapVersionTemplate, BootstrapVersion),
string.Format(UninstallChefClientTemplate, UninstallChefClient));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class VirtualMachineChefExtensionCmdletBase : VirtualMachineExtensionCmdl
protected const string DeleteChefConfigTemplate = "\"deleteChefConfig\":\"{0}\"";
protected const string ClientRbTemplate = "\"client_rb\":\"{0}\"";
protected const string BootstrapVersionTemplate = "\"bootstrap_version\":\"{0}\"";
protected const string UninstallChefClientTemplate = "\"uninstallChefClient\":\"{0}\"";
protected const string BootStrapOptionsTemplate = "\"bootstrap_options\":{0}";
protected const string RunListTemplate = "\"runlist\": \"\\\"{0}\\\"\"";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35131,6 +35131,12 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
<maml:name>UninstallChefClient</maml:name>
<maml:description>
<maml:para>Indicates that this cmdlet uninstalls the Chef Client on the vitual machine.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
<maml:name>OrganizationName</maml:name>
<maml:description>
Expand Down Expand Up @@ -35226,6 +35232,12 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
<maml:name>UninstallChefClient</maml:name>
<maml:description>
<maml:para>Indicates that this cmdlet uninstalls the Chef Client on the vitual machine.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
<maml:name>OrganizationName</maml:name>
<maml:description>
Expand Down Expand Up @@ -35354,6 +35366,18 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
</dev:type>
<dev:defaultValue>none</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
<maml:name>UninstallChefClient</maml:name>
<maml:description>
<maml:para>Indicates that this cmdlet uninstalls the Chef Client on the vitual machine.</maml:para>
</maml:description>
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>none</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>Linux</maml:name>
<maml:description>
Expand Down