Skip to content

Commit c0c6114

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into tiano-d2
2 parents cc3ddd4 + 9826270 commit c0c6114

File tree

10 files changed

+30
-19
lines changed

10 files changed

+30
-19
lines changed

src/ResourceManager/Automation/Commands.Automation.Test/UnitTests/RegisterAzureAutomationScheduledRunbookTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ public void RegisterAzureAutomationScheduledRunbookSuccessfull()
5050
string accountName = "automation";
5151
string runbookName = "runbook";
5252
string scheduleName = "schedule";
53+
string runOn = "hybridWorkerGroup";
5354

5455
this.mockAutomationClient.Setup(
55-
f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null));
56+
f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null, runOn));
5657

5758
// Test
5859
this.cmdlet.ResourceGroupName = resourceGroupName;
@@ -62,7 +63,7 @@ public void RegisterAzureAutomationScheduledRunbookSuccessfull()
6263
this.cmdlet.ExecuteCmdlet();
6364

6465
// Assert
65-
this.mockAutomationClient.Verify(f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null), Times.Once());
66+
this.mockAutomationClient.Verify(f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null, runOn), Times.Once());
6667
}
6768
}
6869
}

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,23 @@ public class RegisterAzureAutomationScheduledRunbook : AzureAutomationBaseCmdlet
5151
HelpMessage = "The runbook parameters.")]
5252
public IDictionary Parameters { get; set; }
5353

54+
/// <summary>
55+
/// Gets or sets the optional hybrid agent friendly name upon which the runbook should be executed.
56+
/// </summary>
57+
[Alias("HybridWorker")]
58+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookNameAndScheduleName, Mandatory = false, ValueFromPipelineByPropertyName = true,
59+
HelpMessage = "The name of the hybrid runbook worker group.")]
60+
public string RunOn { get; set; }
61+
5462
/// <summary>
5563
/// Execute this cmdlet.
5664
/// </summary>
5765
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
5866
protected override void AutomationProcessRecord()
59-
{
60-
JobSchedule jobSchedule;
61-
62-
jobSchedule = this.AutomationClient.RegisterScheduledRunbook(
63-
this.ResourceGroupName, this.AutomationAccountName, this.RunbookName, this.ScheduleName, this.Parameters);
64-
67+
{
68+
var jobSchedule = this.AutomationClient.RegisterScheduledRunbook(
69+
this.ResourceGroupName, this.AutomationAccountName, this.RunbookName, this.ScheduleName, this.Parameters, this.RunOn);
70+
6571
this.WriteObject(jobSchedule);
6672
}
6773
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ public IEnumerable<JobSchedule> ListJobSchedulesByScheduleName(string resourceGr
15071507
}
15081508

15091509
public JobSchedule RegisterScheduledRunbook(string resourceGroupName, string automationAccountName, string runbookName,
1510-
string scheduleName, IDictionary parameters)
1510+
string scheduleName, IDictionary parameters, string runOn)
15111511
{
15121512
var processedParameters = this.ProcessRunbookParameters(resourceGroupName, automationAccountName, runbookName, parameters);
15131513
var sdkJobSchedule = this.automationManagementClient.JobSchedules.Create(
@@ -1519,7 +1519,8 @@ public JobSchedule RegisterScheduledRunbook(string resourceGroupName, string aut
15191519
{
15201520
Schedule = new ScheduleAssociationProperty { Name = scheduleName },
15211521
Runbook = new RunbookAssociationProperty { Name = runbookName },
1522-
Parameters = processedParameters
1522+
Parameters = processedParameters,
1523+
RunOn = runOn
15231524
}
15241525
}).JobSchedule;
15251526

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ IEnumerable<JobStream> GetJobStream(string resourceGroupName, string automationA
291291
IEnumerable<JobSchedule> ListJobSchedulesByRunbookName(string resourceGroupName, string automationAccountName, string runbookName);
292292

293293
IEnumerable<JobSchedule> ListJobSchedulesByScheduleName(string resourceGroupName, string automationAccountName, string scheduleName);
294-
295-
JobSchedule RegisterScheduledRunbook(string resourceGroupName, string automationAccountName, string runbookName, string scheduleName, IDictionary parameters);
294+
295+
JobSchedule RegisterScheduledRunbook(string resourceGroupName, string automationAccountName, string runbookName, string scheduleName, IDictionary parameters, string RunOn);
296296

297297
void UnregisterScheduledRunbook(string resourceGroupName, string automationAccountName, Guid jobScheduleId);
298298

src/ResourceManager/Automation/Commands.Automation/Model/JobSchedule.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public JobSchedule(string resourceGroupName, string automationAccountName, Azure
4646
this.RunbookName = jobSchedule.Properties.Runbook.Name;
4747
this.ScheduleName = jobSchedule.Properties.Schedule.Name;
4848
this.Parameters = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
49+
this.RunOn = jobSchedule.Properties.RunOn;
4950
foreach (var kvp in jobSchedule.Properties.Parameters.Where(kvp => 0 != String.Compare(kvp.Key, Constants.JobStartedByParameterName, CultureInfo.InvariantCulture,
5051
CompareOptions.IgnoreCase)))
5152
{
@@ -65,6 +66,8 @@ public JobSchedule()
6566
/// </summary>
6667
public string ResourceGroupName { get; set; }
6768

69+
public string RunOn { get; set; }
70+
6871
/// <summary>
6972
/// Gets or sets the automation account name.
7073
/// </summary>

src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestVirtualMachineSingleNetworkInterface.json">
399399
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
400400
</None>
401-
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestVirtualMachineSingleNetworkInterfaceWithAcceleratedNetworking.json">
401+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestSingleNetworkInterfaceWithAcceleratedNetworking.json">
402402
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
403403
</None>
404404
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestVMNicWithAcceleratedNetworkingValidations.json">

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineNetworkInterfaceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void TestEffectiveRoutesAndNsg()
6262

6363
[Fact]
6464
[Trait(Category.AcceptanceType, Category.CheckIn)]
65-
public void TestVirtualMachineSingleNetworkInterfaceWithAcceleratedNetworking()
65+
public void TestSingleNetworkInterfaceWithAcceleratedNetworking()
6666
{
6767
ComputeTestController.NewInstance.RunPsTest("Test-SingleNetworkInterfaceWithAcceleratedNetworking");
6868
}

tools/Build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
$scriptFolder = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
1616
. ($scriptFolder + '.\SetupEnv.ps1')
1717

18-
msbuild "$env:AzurePSRoot\build.proj" /t:Build
18+
msbuild "$env:AzurePSRoot\build.proj" /t:Build

tools/StaticAnalysis/StaticAnalysis.Test/SignatureVerifierTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public SignatureVerifierTests()
3838
/// <summary>
3939
///
4040
/// </summary>
41-
[Fact]
41+
[Fact(Skip = "See Azure PowerShell issue #2987 - https://github.com/Azure/azure-powershell/issues/2987")]
4242
public void AddVerbWithoutSupportsShouldProcessParameter()
4343
{
4444
cmdletSignatureVerifier.Analyze(
@@ -68,7 +68,7 @@ public void AddVerbWithSupportsShouldProcessParameter()
6868

6969
#region ForceSwitch and SupportsShouldProcess
7070

71-
[Fact]
71+
[Fact(Skip = "See Azure PowerShell issue #2987 - https://github.com/Azure/azure-powershell/issues/2987")]
7272
public void ForceParameterWithoutSupportsShouldProcess()
7373
{
7474
cmdletSignatureVerifier.Analyze(
@@ -108,7 +108,7 @@ public void ConfirmImpactWithSupportsShouldProcess()
108108
Assert.True(testReport.ProblemIdList.Count == 0);
109109
}
110110

111-
[Fact]
111+
[Fact(Skip = "See Azure PowerShell issue #2987 - https://github.com/Azure/azure-powershell/issues/2987")]
112112
public void ConfirmImpactWithoutSupportsShouldProcess()
113113
{
114114
cmdletSignatureVerifier.Analyze(
@@ -136,7 +136,7 @@ public void ShouldContinueVerbWithForceSwitch()
136136
Assert.True(testReport.ProblemIdList.Count == 0);
137137
}
138138

139-
[Fact]
139+
[Fact(Skip = "See Azure PowerShell issue #2987 - https://github.com/Azure/azure-powershell/issues/2987")]
140140
public void ShouldContinueVerbWithoutForceSwitch()
141141
{
142142
cmdletSignatureVerifier.Analyze(

0 commit comments

Comments
 (0)