Skip to content

Commit

Permalink
Merge pull request Azure#3799 from MsysTechnologiesllc/piyush/chef_da…
Browse files Browse the repository at this point in the history
…emon_interval

Renamed chef-service-interval to chef-daemon-interval
  • Loading branch information
cormacpayne authored May 2, 2017
2 parents 7542d78 + 040fc15 commit f0d7c6e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 21 deletions.
1 change: 1 addition & 0 deletions src/ResourceManager/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
## Current Release

* Backup encryption settings for IaaS VMs and restore on failure
* ChefServiceInterval option is renamed to ChefDaemonInterval now. Old one will continue to work however.

## Version 2.9.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineExtensionBaseCmdlet
private string ClientRbTemplate = "client_rb";
private string BootStrapOptionsTemplate = "bootstrap_options";
private string JsonAttributeTemplate = "custom_json_attr";
private string ChefServiceIntervalTemplate = "chef_service_interval";
private string ChefDaemonIntervalTemplate = "chef_daemon_interval";
private string RunListTemplate = "runlist";
private string DaemonTemplate = "daemon";
private string SecretTemplate = "encrypted_data_bag_secret";
Expand Down Expand Up @@ -110,11 +110,12 @@ public string TypeHandlerVersion
[ValidateNotNullOrEmpty]
public string JsonAttribute { get; set; }

[Alias("ChefServiceInterval")]
[Parameter(
ValueFromPipelineByPropertyName = true,
HelpMessage = "Specifies the frequency (in minutes) at which the chef-service runs. If in case you don't want the chef-service to be installed on the Azure VM then set value as 0 in this field.")]
[ValidateNotNullOrEmpty]
public string ChefServiceInterval { get; set; }
public string ChefDaemonInterval { get; set; }

[Parameter(
ValueFromPipelineByPropertyName = true,
Expand Down Expand Up @@ -252,7 +253,7 @@ private Hashtable PublicConfiguration
bool IsRunListEmpty = string.IsNullOrEmpty(this.RunList);
bool IsBootstrapOptionsEmpty = string.IsNullOrEmpty(this.BootstrapOptions);
bool IsJsonAttributeEmpty = string.IsNullOrEmpty(this.JsonAttribute);
bool IsChefServiceIntervalEmpty = string.IsNullOrEmpty(this.ChefServiceInterval);
bool IsChefDaemonIntervalEmpty = string.IsNullOrEmpty(this.ChefDaemonInterval);
string BootstrapVersion = string.IsNullOrEmpty(this.BootstrapVersion) ? "" : this.BootstrapVersion;
bool IsDaemonEmpty = string.IsNullOrEmpty(this.Daemon);

Expand Down Expand Up @@ -322,9 +323,9 @@ private Hashtable PublicConfiguration
hashTable.Add(JsonAttributeTemplate, JsonAttribute);
}

if (!IsChefServiceIntervalEmpty)
if (!IsChefDaemonIntervalEmpty)
{
hashTable.Add(ChefServiceIntervalTemplate, ChefServiceInterval);
hashTable.Add(ChefDaemonIntervalTemplate, ChefDaemonInterval);
}

if (this.Windows.IsPresent && !IsDaemonEmpty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ Adds a Chef extension to a virtual machine.
```
Set-AzureRmVMChefExtension [-ResourceGroupName] <String> [-VMName] <String> [[-TypeHandlerVersion] <String>]
-ValidationPem <String> [-ClientRb <String>] [-BootstrapOptions <String>] [-JsonAttribute <String>]
[-ChefServiceInterval <String>] [-Daemon <String>] [-Secret <String>] [-SecretFile <String>]
[-RunList <String>] [-ChefServerUrl <String>] [-ValidationClientName <String>] [-OrganizationName <String>]
[-BootstrapVersion <String>] [-Linux] [[-Location] <String>] [[-Name] <String>]
[-ChefDaemonInterval <String>] [-RunList <String>] [-ChefServerUrl <String>] [-ValidationClientName <String>]
[-OrganizationName <String>] [-BootstrapVersion <String>] [-Linux] [[-Location] <String>] [[-Name] <String>]
[[-AutoUpgradeMinorVersion] <Boolean>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### Windows
```
Set-AzureRmVMChefExtension [-ResourceGroupName] <String> [-VMName] <String> [[-TypeHandlerVersion] <String>]
-ValidationPem <String> [-ClientRb <String>] [-BootstrapOptions <String>] [-JsonAttribute <String>]
[-ChefServiceInterval <String>] [-Daemon <String>] [-Secret <String>] [-SecretFile <String>]
[-RunList <String>] [-ChefServerUrl <String>] [-ValidationClientName <String>] [-OrganizationName <String>]
[-BootstrapVersion <String>] [-Windows] [[-Location] <String>] [[-Name] <String>]
[-ChefDaemonInterval <String>] [-RunList <String>] [-ChefServerUrl <String>] [-ValidationClientName <String>]
[-OrganizationName <String>] [-BootstrapVersion <String>] [-Windows] [[-Location] <String>] [[-Name] <String>]
[[-AutoUpgradeMinorVersion] <Boolean>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

Expand Down Expand Up @@ -122,7 +120,7 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -ChefServiceInterval
### -ChefDaemonInterval
Specifies the frequency (in minutes) at which the chef-service runs. If in case you don't want the chef-service to be installed on the Azure VM then set value as 0 in this field.```yaml
Type: String
Parameter Sets: (All)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function Test-SetAzureVMChefExtension
New-AzureQuickVM -Windows -ImageName "a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-20161214-en.us-127GB.vhd" -Name $vmName -ServiceName $svcName -AdminUsername "pstestuser" -Password $PLACEHOLDER
$vm = Get-AzureVM -ServiceName $svcName -Name $vmName

Set-AzureVMChefExtension -VM $vm -ValidationPem "$TestOutputRoot\Resources\ChefExtension\tstorgnztn-validator.pem" -ClientRb "$TestOutputRoot\Resources\ChefExtension\client.rb" -JsonAttribute '{"container_service": {"chef-init-test": {"command": "C:\\opscode\\chef\\bin"}}}' -ChefServiceInterval 35 -Windows
Set-AzureVMChefExtension -VM $vm -ValidationPem "$TestOutputRoot\Resources\ChefExtension\tstorgnztn-validator.pem" -ClientRb "$TestOutputRoot\Resources\ChefExtension\client.rb" -JsonAttribute '{"container_service": {"chef-init-test": {"command": "C:\\opscode\\chef\\bin"}}}' -ChefDaemonInterval 35 -Windows

Update-AzureVM -VM $vm.VM -ServiceName $svcName -Name $vmName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineChefExtensionCmdletB
[ValidateNotNullOrEmpty]
public string JsonAttribute { get; set; }

[Alias("ChefServiceInterval")]
[Parameter(
ValueFromPipelineByPropertyName = true,
HelpMessage = "Specifies the frequency (in minutes) at which the chef-service runs. If in case you don't want the chef-service to be installed on the Azure VM then set value as 0 in this field.")]
[ValidateNotNullOrEmpty]
public string ChefServiceInterval { get; set; }
public string ChefDaemonInterval { get; set; }

[Parameter(
ValueFromPipelineByPropertyName = true,
Expand Down Expand Up @@ -208,7 +209,7 @@ private void SetPublicConfig()
bool IsRunListEmpty = string.IsNullOrEmpty(this.RunList);
bool IsBootstrapOptionsEmpty = string.IsNullOrEmpty(this.BootstrapOptions);
bool IsJsonAttributeEmpty = string.IsNullOrEmpty(this.JsonAttribute);
bool IsChefServiceIntervalEmpty = string.IsNullOrEmpty(this.ChefServiceInterval);
bool IsChefDaemonIntervalEmpty = string.IsNullOrEmpty(this.ChefDaemonInterval);
string BootstrapVersion = string.IsNullOrEmpty(this.BootstrapVersion) ? "" : this.BootstrapVersion;
bool IsDaemonEmpty = string.IsNullOrEmpty(this.Daemon);

Expand Down Expand Up @@ -278,9 +279,9 @@ private void SetPublicConfig()
hashTable.Add(JsonAttributeTemplate, JsonAttribute);
}

if (!IsChefServiceIntervalEmpty)
if (!IsChefDaemonIntervalEmpty)
{
hashTable.Add(ChefServiceIntervalTemplate, this.ChefServiceInterval);
hashTable.Add(ChefDaemonIntervalTemplate, this.ChefDaemonInterval);
}

if (this.Windows.IsPresent && !IsDaemonEmpty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class VirtualMachineChefExtensionCmdletBase : VirtualMachineExtensionCmdl
protected const string BootstrapVersionTemplate = "bootstrap_version";
protected const string BootStrapOptionsTemplate = "bootstrap_options";
protected const string JsonAttributeTemplate = "custom_json_attr";
protected const string ChefServiceIntervalTemplate = "chef_service_interval";
protected const string ChefDaemonIntervalTemplate = "chef_daemon_interval";
protected const string RunListTemplate = "runlist";
protected const string DaemonTemplate = "daemon";
protected const string SecretTemplate = "encrypted_data_bag_secret";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45081,7 +45081,7 @@ PS C:\&gt; Set-AzureServiceAntimalwareExtension -ServiceName "ContosoService03"
<maml:uri /></dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"><maml:name>ChefServiceInterval</maml:name>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"><maml:name>ChefDaemonInterval</maml:name>
<maml:Description><maml:para>Specifies the frequency (in minutes) at which the chef-service runs. If in case you don't want the chef-service to be installed on the Azure VM then set value as 0 in this field.
</maml:para>
</maml:Description>
Expand Down Expand Up @@ -45262,7 +45262,7 @@ PS C:\&gt; Set-AzureServiceAntimalwareExtension -ServiceName "ContosoService03"
<maml:uri /></dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"><maml:name>ChefServiceInterval</maml:name>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"><maml:name>ChefDaemonInterval</maml:name>
<maml:Description><maml:para>Specifies the frequency (in minutes) at which the chef-service runs. If in case you don't want the chef-service to be installed on the Azure VM then set value as 0 in this field.
</maml:para>
</maml:Description>
Expand Down Expand Up @@ -45416,7 +45416,7 @@ PS C:\&gt; Set-AzureServiceAntimalwareExtension -ServiceName "ContosoService03"
<maml:uri /></dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"><maml:name>ChefServiceInterval</maml:name>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"><maml:name>ChefDaemonInterval</maml:name>
<maml:Description><maml:para>Specifies the frequency (in minutes) at which the chef-service runs. If in case you don't want the chef-service to be installed on the Azure VM then set value as 0 in this field.
</maml:para>
</maml:Description>
Expand Down

0 comments on commit f0d7c6e

Please sign in to comment.