File tree Expand file tree Collapse file tree 3 files changed +19
-11
lines changed
ResourceManager/Compute/Commands.Compute/Extension/Chef
ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Chef Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -433,19 +433,23 @@ private void ValidateParameters()
433
433
bool IsClientRbEmpty = string . IsNullOrEmpty ( this . ClientRb ) ;
434
434
bool IsChefServerUrlEmpty = string . IsNullOrEmpty ( this . ChefServerUrl ) ;
435
435
bool IsValidationClientNameEmpty = string . IsNullOrEmpty ( this . ValidationClientName ) ;
436
+ bool IsDaemonEmpty = string . IsNullOrEmpty ( this . Daemon ) ;
436
437
// Validate ClientRb or ChefServerUrl and ValidationClientName should exist.
437
438
if ( IsClientRbEmpty && ( IsChefServerUrlEmpty || IsValidationClientNameEmpty ) )
438
439
{
439
440
throw new ArgumentException (
440
441
"Required -ClientRb or -ChefServerUrl and -ValidationClientName options." ) ;
441
442
}
442
443
443
- bool IsDaemonValueInvalid = Array . IndexOf ( new String [ 2 ] { "none" , "service" } , this . Daemon ) == - 1 ;
444
- // Validation against the invalid use of Daemon option.
445
- if ( IsDaemonValueInvalid || this . Linux . IsPresent )
444
+ if ( ! IsDaemonEmpty )
446
445
{
447
- throw new ArgumentException (
448
- "Invalid use of -Daemon option." ) ;
446
+ bool IsDaemonValueInvalid = Array . IndexOf ( new String [ 2 ] { "none" , "service" } , this . Daemon ) == - 1 ;
447
+ // Validation against the invalid use of Daemon option.
448
+ if ( IsDaemonValueInvalid || this . Linux . IsPresent )
449
+ {
450
+ throw new ArgumentException (
451
+ "Invalid use of -Daemon option." ) ;
452
+ }
449
453
}
450
454
451
455
if ( ! string . IsNullOrEmpty ( this . SecretFile ) && ! File . Exists ( this . SecretFile ) )
Original file line number Diff line number Diff line change @@ -293,19 +293,23 @@ protected override void ValidateParameters()
293
293
bool IsClientRbEmpty = string . IsNullOrEmpty ( this . ClientRb ) ;
294
294
bool IsChefServerUrlEmpty = string . IsNullOrEmpty ( this . ChefServerUrl ) ;
295
295
bool IsValidationClientNameEmpty = string . IsNullOrEmpty ( this . ValidationClientName ) ;
296
+ bool IsDaemonEmpty = string . IsNullOrEmpty ( this . Daemon ) ;
296
297
// Validate ClientRb or ChefServerUrl and ValidationClientName should exist.
297
298
if ( IsClientRbEmpty && ( IsChefServerUrlEmpty || IsValidationClientNameEmpty ) )
298
299
{
299
300
throw new ArgumentException (
300
301
"Required -ClientRb or -ChefServerUrl and -ValidationClientName options." ) ;
301
302
}
302
303
303
- bool IsDaemonValueInvalid = Array . IndexOf ( new String [ 2 ] { "none" , "service" } , this . Daemon ) == - 1 ;
304
- // Validation against the invalid use of Daemon option.
305
- if ( IsDaemonValueInvalid || this . Linux . IsPresent )
304
+ if ( ! IsDaemonEmpty )
306
305
{
307
- throw new ArgumentException (
308
- "Invalid use of -Daemon option." ) ;
306
+ bool IsDaemonValueInvalid = Array . IndexOf ( new String [ 2 ] { "none" , "service" } , this . Daemon ) == - 1 ;
307
+ // Validation against the invalid use of Daemon option.
308
+ if ( IsDaemonValueInvalid || this . Linux . IsPresent )
309
+ {
310
+ throw new ArgumentException (
311
+ "Invalid use of -Daemon option." ) ;
312
+ }
309
313
}
310
314
311
315
if ( ! string . IsNullOrEmpty ( this . SecretFile ) && ! File . Exists ( this . SecretFile ) )
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public class VirtualMachineChefExtensionCmdletBase : VirtualMachineExtensionCmdl
21
21
protected const string ExtensionDefaultPublisher = "Chef.Bootstrap.WindowsAzure" ;
22
22
protected const string ExtensionDefaultName = "ChefClient" ;
23
23
protected const string LinuxExtensionName = "LinuxChefClient" ;
24
- protected const string PrivateConfigurationTemplate = "{{ \" validation_key\" : \" {0} \" }} " ;
24
+ protected const string PrivateConfigurationTemplate = "validation_key" ;
25
25
protected const string ClientRbTemplate = "client_rb" ;
26
26
protected const string BootstrapVersionTemplate = "bootstrap_version" ;
27
27
protected const string BootStrapOptionsTemplate = "bootstrap_options" ;
You can’t perform that action at this time.
0 commit comments