Skip to content

Commit 139de31

Browse files
committed
fixed merge conflicts
2 parents e5a484f + 1c56062 commit 139de31

File tree

8 files changed

+57
-13
lines changed

8 files changed

+57
-13
lines changed

src/ResourceManager/Automation/Commands.Automation/Cmdlet/GetAzureAutomationDscCompilationJobOutput.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class GetAzureAutomationDscCompilationJobOutput : AzureAutomationBaseCmdl
3838
public Guid Id { get; set; }
3939

4040
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The stream type.")]
41-
[ValidateSet("Warning", "Error", "Verbose", "Any")]
41+
[ValidateSet("Warning", "Error", "Verbose", "Any", IgnoreCase = true)]
4242
public CompilationJobStreamType Stream { get; set; }
4343

4444
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Retrieves output created after this time")]

src/ResourceManager/Automation/Commands.Automation/Cmdlet/GetAzureAutomationDscNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class GetAzureAutomationDscNode : AzureAutomationBaseCmdlet
4242
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByName, Mandatory = false, HelpMessage = "Filter dsc nodes based on their status.")]
4343
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByNodeConfiguration, Mandatory = false, HelpMessage = "Filter dsc nodes based on their status.")]
4444
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByAll, Mandatory = false, HelpMessage = "Filter dsc nodes based on their status.")]
45-
[ValidateSet("Compliant", "NotCompliant", "Failed", "Pending", "Received", "Unresponsive")]
45+
[ValidateSet("Compliant", "NotCompliant", "Failed", "Pending", "Received", "Unresponsive", IgnoreCase = true)]
4646
public DscNodeStatus Status { get; set; }
4747

4848
/// <summary>

src/ResourceManager/Automation/Commands.Automation/Cmdlet/GetAzureAutomationDscNodeConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class GetAzureAutomationDscNodeConfiguration : AzureAutomationBaseCmdlet
4848
/// </summary>
4949
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByConfigurationName, Mandatory = false, HelpMessage = "Filter node configurations by RollupStatus.")]
5050
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByAll, Mandatory = false, HelpMessage = "Filter node configurations by RollupStatus.")]
51-
[ValidateSet("Good", "Bad")]
51+
[ValidateSet("Good", "Bad", IgnoreCase = true)]
5252
public string RollupStatus { get; set; }
5353

5454
/// <summary>

src/ResourceManager/Automation/Commands.Automation/Cmdlet/RegisterAzureAutomationDscNode.cs

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ public class RegisterAzureAutomationDscNode : AzureAutomationBaseCmdlet
6767
/// </summary>
6868
private string configurationMode = "ApplyAndMonitor";
6969

70+
/// <summary>
71+
/// Default value for AzureVMResourceGroup
72+
/// </summary>
73+
private string azureVmResourceGroup = String.Empty;
74+
75+
/// <summary>
76+
/// Default value for AzureVmLocation
77+
/// </summary>
78+
private string azureVmLocation = String.Empty;
79+
7080
/// <summary>
7181
/// Gets or sets the VM name.
7282
/// </summary>
@@ -88,7 +98,7 @@ public string NodeConfigurationName
8898
/// Gets or sets the configuration mode
8999
/// </summary>
90100
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "DSC configuration mode.")]
91-
[ValidateSet("ApplyAndMonitor", "ApplyAndAutocorrect", "ApplyOnly")]
101+
[ValidateSet("ApplyAndMonitor", "ApplyAndAutocorrect", "ApplyOnly", IgnoreCase = true)]
92102
public string ConfigurationMode
93103
{
94104
get { return this.configurationMode; }
@@ -111,10 +121,10 @@ public int ConfigurationModeFrequencyMins
111121
/// </summary>
112122
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Represents the frequency (in minutes) at which the Local Configuration Manager contacts the Azure Automation DSC pull server to download the latest node configuration.")]
113123
[ValidateRange(30, 44640)]
114-
public int RefreshFrequencyMins
124+
public int RefreshFrequencyMins
115125
{
116126
get { return this.refreshFrequencyMins; }
117-
set { this.refreshFrequencyMins = value; }
127+
set { this.refreshFrequencyMins = value; }
118128
}
119129

120130
/// <summary>
@@ -131,7 +141,7 @@ public bool RebootNodeIfNeeded
131141
/// Gets or sets the action to perform post reboot.
132142
/// </summary>
133143
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Action to perform after a reboot.")]
134-
[ValidateSet("ContinueConfiguration", "StopConfiguration")]
144+
[ValidateSet("ContinueConfiguration", "StopConfiguration", IgnoreCase = true)]
135145
public string ActionAfterReboot
136146
{
137147
get { return this.actionAfterReboot; }
@@ -149,13 +159,33 @@ public bool AllowModuleOverwrite
149159
set { this.overwriteModulesFlag = value; }
150160
}
151161

162+
/// <summary>
163+
/// Gets or sets the azure VM resource group name.
164+
/// </summary>
165+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Azure VM resource group name.")]
166+
public string AzureVMResourceGroup
167+
{
168+
get { return this.azureVmResourceGroup; }
169+
set { this.azureVmResourceGroup = value; }
170+
}
171+
172+
/// <summary>
173+
/// Gets or sets the azure VM location.
174+
/// </summary>
175+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Azure VM location.")]
176+
public string AzureVMLocation
177+
{
178+
get { return this.azureVmLocation; }
179+
set { this.azureVmLocation = value; }
180+
}
181+
152182
/// <summary>
153183
/// Execute this cmdlet.
154184
/// </summary>
155185
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
156186
public override void ExecuteCmdlet()
157187
{
158-
this.AutomationClient.RegisterDscNode(this.ResourceGroupName, this.AutomationAccountName,this.AzureVMName, this.NodeConfigurationName, this.ConfigurationMode, this.ConfigurationModeFrequencyMins, this.RefreshFrequencyMins, this.RebootNodeIfNeeded, this.ActionAfterReboot, this.AllowModuleOverwrite);
188+
this.AutomationClient.RegisterDscNode(this.ResourceGroupName, this.AutomationAccountName, this.AzureVMName, this.NodeConfigurationName, this.ConfigurationMode, this.ConfigurationModeFrequencyMins, this.RefreshFrequencyMins, this.RebootNodeIfNeeded, this.ActionAfterReboot, this.AllowModuleOverwrite, this.AzureVMResourceGroup, this.AzureVMLocation);
159189
}
160190
}
161191
}

src/ResourceManager/Automation/Commands.Automation/Common/AutomationClientDSC.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,25 @@ public void RegisterDscNode(string resourceGroupName,
739739
int refreshFrequencyMins,
740740
bool rebootFlag,
741741
string actionAfterReboot,
742-
bool moduleOverwriteFlag)
742+
bool moduleOverwriteFlag,
743+
string azureVmResourceGroup,
744+
string azureVmLocation)
743745
{
744746
// get the location from AutomationAccountName. This will validate the account too
745747
string location = this.GetAutomationAccount(resourceGroupName, automationAccountName).Location;
746748

749+
// if vm location is specified, use that
750+
if (!String.IsNullOrEmpty(azureVmLocation))
751+
{
752+
location = azureVmLocation;
753+
}
754+
755+
// if azureVmResourceGroup not specified, use the resource group
756+
if (String.IsNullOrEmpty(azureVmResourceGroup))
757+
{
758+
azureVmResourceGroup = resourceGroupName;
759+
}
760+
747761
string deploymentName = System.DateTimeOffset.Now.LocalDateTime.ToString("yyyyMMddhhmmss");
748762

749763
// get the endpoint and keys
@@ -772,7 +786,7 @@ public void RegisterDscNode(string resourceGroupName,
772786
{
773787
Command invokeCommand = new Command("New-AzureResourceGroupDeployment");
774788
invokeCommand.Parameters.Add("Name", deploymentName);
775-
invokeCommand.Parameters.Add("ResourceGroupName", resourceGroupName);
789+
invokeCommand.Parameters.Add("ResourceGroupName", azureVmResourceGroup);
776790
invokeCommand.Parameters.Add("TemplateParameterObject", templateParameters);
777791
invokeCommand.Parameters.Add("TemplateFile", Constants.TemplateFile);
778792

src/ResourceManager/Automation/Commands.Automation/Common/IAutomationClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ IEnumerable<DscNode> ListDscNodesByConfiguration(
101101

102102
void DeleteDscNode(string resourceGroupName, string automationAccountName, Guid nodeId);
103103

104-
void RegisterDscNode(string resourceGroupName, string automationAccountName, string azureVMName, string nodeconfigurationName, string configurationMode, int configurationModeFrequencyMins, int refreshFrequencyMins, bool rebootFlag, string actionAfterReboot, bool moduleOverwriteFlag);
104+
void RegisterDscNode(string resourceGroupName, string automationAccountName, string azureVMName, string nodeconfigurationName, string configurationMode, int configurationModeFrequencyMins, int refreshFrequencyMins, bool rebootFlag, string actionAfterReboot, bool moduleOverwriteFlag, string azureVmResourceGroup, string azureVmLocation);
105105

106106
#endregion
107107

src/ResourceManager/Automation/Commands.Automation/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/Automation/Commands.Automation/Properties/Resources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
<comment>Automation</comment>
323323
</data>
324324
<data name="RemoveDscNodeWarning" xml:space="preserve">
325-
<value>Are you sure you want to unregister Dsc node from Azure Automation?</value>
325+
<value>Are you sure you want to unregister this node from Azure Automation DSC?</value>
326326
<comment>Automation</comment>
327327
</data>
328328
<data name="RemoveDscNodeDescription" xml:space="preserve">

0 commit comments

Comments
 (0)