Skip to content

Commit f73ba8d

Browse files
authored
Merge pull request #2540 from MsysTechnologiesllc/nim/remove_unused_flags
Removing flags which are not supported by azure-chef-extension now
2 parents 3e0d8f7 + 3a64742 commit f73ba8d

File tree

3 files changed

+8
-122
lines changed

3 files changed

+8
-122
lines changed

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

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -84,30 +84,12 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineChefExtensionCmdletB
8484
[ValidateNotNullOrEmpty]
8585
public string OrganizationName { get; set; }
8686

87-
[Parameter(
88-
ValueFromPipelineByPropertyName = true,
89-
HelpMessage = "Flag to opt for auto chef-client update. Chef-client update is false by default.")]
90-
[ValidateNotNullOrEmpty]
91-
public SwitchParameter AutoUpdateChefClient { get; set; }
92-
93-
[Parameter(
94-
ValueFromPipelineByPropertyName = true,
95-
HelpMessage = "Delete the chef config files during update/uninstall extension. Default is false.")]
96-
[ValidateNotNullOrEmpty]
97-
public SwitchParameter DeleteChefConfig { get; set; }
98-
9987
[Parameter(
10088
ValueFromPipelineByPropertyName = true,
10189
HelpMessage = "Chef client version to be installed with the extension")]
10290
[ValidateNotNullOrEmpty]
10391
public string BootstrapVersion { get; set; }
10492

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-
11193
[Parameter(
11294
Mandatory = true,
11395
ParameterSetName = LinuxParameterSetName,
@@ -177,10 +159,7 @@ private void SetPublicConfig()
177159
bool IsValidationClientNameEmpty = string.IsNullOrEmpty(this.ValidationClientName);
178160
bool IsRunListEmpty = string.IsNullOrEmpty(this.RunList);
179161
bool IsBootstrapOptionsEmpty = string.IsNullOrEmpty(this.BootstrapOptions);
180-
string AutoUpdateChefClient = this.AutoUpdateChefClient.IsPresent ? "true" : "false";
181-
string DeleteChefConfig = this.DeleteChefConfig.IsPresent ? "true" : "false";
182162
string BootstrapVersion = this.BootstrapVersion;
183-
string UninstallChefClient = this.UninstallChefClient.IsPresent ? "true" : "false";
184163

185164
//Cases handled:
186165
// 1. When clientRb given by user and:
@@ -234,46 +213,34 @@ private void SetPublicConfig()
234213
{
235214
if (IsBootstrapOptionsEmpty)
236215
{
237-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
238-
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
239-
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
216+
this.PublicConfiguration = string.Format("{{{0},{1}}}",
240217
string.Format(ClientRbTemplate, ClientConfig),
241-
string.Format(BootstrapVersionTemplate, BootstrapVersion),
242-
string.Format(UninstallChefClientTemplate, UninstallChefClient));
218+
string.Format(BootstrapVersionTemplate, BootstrapVersion));
243219
}
244220
else
245221
{
246-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
247-
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
248-
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
222+
this.PublicConfiguration = string.Format("{{{0},{1},{2}}}",
249223
string.Format(ClientRbTemplate, ClientConfig),
250224
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
251-
string.Format(BootstrapVersionTemplate, BootstrapVersion),
252-
string.Format(UninstallChefClientTemplate, UninstallChefClient));
225+
string.Format(BootstrapVersionTemplate, BootstrapVersion));
253226
}
254227
}
255228
else
256229
{
257230
if (IsBootstrapOptionsEmpty)
258231
{
259-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
260-
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
261-
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
232+
this.PublicConfiguration = string.Format("{{{0},{1},{2}}}",
262233
string.Format(ClientRbTemplate, ClientConfig),
263234
string.Format(RunListTemplate, this.RunList),
264-
string.Format(BootstrapVersionTemplate, BootstrapVersion),
265-
string.Format(UninstallChefClientTemplate, UninstallChefClient));
235+
string.Format(BootstrapVersionTemplate, BootstrapVersion));
266236
}
267237
else
268238
{
269-
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5},{6}}}",
270-
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
271-
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
239+
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3}}}",
272240
string.Format(ClientRbTemplate, ClientConfig),
273241
string.Format(RunListTemplate, this.RunList),
274242
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
275-
string.Format(BootstrapVersionTemplate, BootstrapVersion),
276-
string.Format(UninstallChefClientTemplate, UninstallChefClient));
243+
string.Format(BootstrapVersionTemplate, BootstrapVersion));
277244
}
278245
}
279246
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@ public class VirtualMachineChefExtensionCmdletBase : VirtualMachineExtensionCmdl
2222
protected const string ExtensionDefaultName = "ChefClient";
2323
protected const string LinuxExtensionName = "LinuxChefClient";
2424
protected const string PrivateConfigurationTemplate = "{{\"validation_key\":\"{0}\"}}";
25-
protected const string AutoUpdateTemplate = "\"autoUpdateClient\":\"{0}\"";
26-
protected const string DeleteChefConfigTemplate = "\"deleteChefConfig\":\"{0}\"";
2725
protected const string ClientRbTemplate = "\"client_rb\":\"{0}\"";
2826
protected const string BootstrapVersionTemplate = "\"bootstrap_version\":\"{0}\"";
29-
protected const string UninstallChefClientTemplate = "\"uninstallChefClient\":\"{0}\"";
3027
protected const string BootStrapOptionsTemplate = "\"bootstrap_options\":{0}";
3128
protected const string RunListTemplate = "\"runlist\": \"\\\"{0}\\\"\"";
3229

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

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -127816,34 +127816,13 @@ Standard_ZRS or Premium_LRS accounts cannot be changed to other account types, a
127816127816
</maml:description>
127817127817
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
127818127818
</command:parameter>
127819-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
127820-
<maml:name>AutoUpdateChefClient</maml:name>
127821-
<maml:description>
127822-
<maml:para />
127823-
</maml:description>
127824-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
127825-
</command:parameter>
127826-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
127827-
<maml:name>DeleteChefConfig</maml:name>
127828-
<maml:description>
127829-
<maml:para>Indicates that this cmdlet deletes the Chef configuration on the virtual machine.</maml:para>
127830-
</maml:description>
127831-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
127832-
</command:parameter>
127833127819
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
127834127820
<maml:name>BootstrapVersion</maml:name>
127835127821
<maml:description>
127836127822
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
127837127823
</maml:description>
127838127824
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
127839127825
</command:parameter>
127840-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
127841-
<maml:name>UninstallChefClient</maml:name>
127842-
<maml:description>
127843-
<maml:para>Indicates that this cmdlet uninstalls the Chef Client on the vitual machine.</maml:para>
127844-
</maml:description>
127845-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
127846-
</command:parameter>
127847127826
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
127848127827
<maml:name>Windows</maml:name>
127849127828
<maml:description>
@@ -127938,34 +127917,13 @@ Standard_ZRS or Premium_LRS accounts cannot be changed to other account types, a
127938127917
</maml:description>
127939127918
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
127940127919
</command:parameter>
127941-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
127942-
<maml:name>AutoUpdateChefClient</maml:name>
127943-
<maml:description>
127944-
<maml:para />
127945-
</maml:description>
127946-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
127947-
</command:parameter>
127948-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
127949-
<maml:name>DeleteChefConfig</maml:name>
127950-
<maml:description>
127951-
<maml:para>Indicates that this cmdlet deletes the Chef configuration on the virtual machine.</maml:para>
127952-
</maml:description>
127953-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
127954-
</command:parameter>
127955127920
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
127956127921
<maml:name>BootstrapVersion</maml:name>
127957127922
<maml:description>
127958127923
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
127959127924
</maml:description>
127960127925
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
127961127926
</command:parameter>
127962-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
127963-
<maml:name>UninstallChefClient</maml:name>
127964-
<maml:description>
127965-
<maml:para>Indicates that this cmdlet uninstalls the Chef Client on the vitual machine.</maml:para>
127966-
</maml:description>
127967-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
127968-
</command:parameter>
127969127927
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
127970127928
<maml:name>Linux</maml:name>
127971127929
<maml:description>
@@ -128100,30 +128058,6 @@ Standard_ZRS or Premium_LRS accounts cannot be changed to other account types, a
128100128058
</dev:type>
128101128059
<dev:defaultValue>none</dev:defaultValue>
128102128060
</command:parameter>
128103-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
128104-
<maml:name>AutoUpdateChefClient</maml:name>
128105-
<maml:description>
128106-
<maml:para />
128107-
</maml:description>
128108-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
128109-
<dev:type>
128110-
<maml:name>SwitchParameter</maml:name>
128111-
<maml:uri/>
128112-
</dev:type>
128113-
<dev:defaultValue>none</dev:defaultValue>
128114-
</command:parameter>
128115-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
128116-
<maml:name>DeleteChefConfig</maml:name>
128117-
<maml:description>
128118-
<maml:para>Indicates that this cmdlet deletes the Chef configuration on the virtual machine.</maml:para>
128119-
</maml:description>
128120-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
128121-
<dev:type>
128122-
<maml:name>SwitchParameter</maml:name>
128123-
<maml:uri/>
128124-
</dev:type>
128125-
<dev:defaultValue>none</dev:defaultValue>
128126-
</command:parameter>
128127128061
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
128128128062
<maml:name>BootstrapVersion</maml:name>
128129128063
<maml:description>
@@ -128136,18 +128070,6 @@ Standard_ZRS or Premium_LRS accounts cannot be changed to other account types, a
128136128070
</dev:type>
128137128071
<dev:defaultValue>none</dev:defaultValue>
128138128072
</command:parameter>
128139-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
128140-
<maml:name>UninstallChefClient</maml:name>
128141-
<maml:description>
128142-
<maml:para>Indicates that this cmdlet uninstalls the Chef Client on the vitual machine.</maml:para>
128143-
</maml:description>
128144-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
128145-
<dev:type>
128146-
<maml:name>SwitchParameter</maml:name>
128147-
<maml:uri/>
128148-
</dev:type>
128149-
<dev:defaultValue>none</dev:defaultValue>
128150-
</command:parameter>
128151128073
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
128152128074
<maml:name>Windows</maml:name>
128153128075
<maml:description>

0 commit comments

Comments
 (0)