Skip to content

Commit 2526c91

Browse files
author
NimishaS
committed
Removed unwanted options from ASM command
1 parent f8b304f commit 2526c91

File tree

1 file changed

+8
-41
lines changed

1 file changed

+8
-41
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
}

0 commit comments

Comments
 (0)