Skip to content

Commit 0a141da

Browse files
author
Hovsep Mkrtchyan
committed
Merge branch 'clu' of github.com:Azure/azure-powershell into clu
Conflicts: src/CLU/CLUCoreCLR.sln
2 parents 88984db + fef5c28 commit 0a141da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3950
-23
lines changed

src/CLU/CLUCoreCLR.sln

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24711.0
4+
VisualStudioVersion = 14.0.23107.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.Common", "Commands.Common\Commands.Common.xproj", "{5F567ACA-595E-436D-83DB-A21E08F82DF6}"
77
EndProject
@@ -13,6 +13,10 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Pr
1313
EndProject
1414
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.ResourceManager.Cmdlets", "Commands.ResourceManager.Cmdlets\Commands.ResourceManager.Cmdlets.xproj", "{D3F16CA7-CF23-4EBD-B70E-336D2D12415E}"
1515
EndProject
16+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Profile.Test", "Microsoft.Azure.Commands.Profile.Test\Microsoft.Azure.Commands.Profile.Test.xproj", "{E267C25B-98EA-4872-9753-4F6B22F7CA24}"
17+
EndProject
18+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.ScenarioTests.ResourceManager.Common", "Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.xproj", "{9D1F91E1-B319-4914-B09B-60070C5531C7}"
19+
EndProject
1620
Global
1721
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1822
Debug|Any CPU = Debug|Any CPU
@@ -39,6 +43,14 @@ Global
3943
{D3F16CA7-CF23-4EBD-B70E-336D2D12415E}.Debug|Any CPU.Build.0 = Debug|Any CPU
4044
{D3F16CA7-CF23-4EBD-B70E-336D2D12415E}.Release|Any CPU.ActiveCfg = Release|Any CPU
4145
{D3F16CA7-CF23-4EBD-B70E-336D2D12415E}.Release|Any CPU.Build.0 = Release|Any CPU
46+
{E267C25B-98EA-4872-9753-4F6B22F7CA24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47+
{E267C25B-98EA-4872-9753-4F6B22F7CA24}.Debug|Any CPU.Build.0 = Debug|Any CPU
48+
{E267C25B-98EA-4872-9753-4F6B22F7CA24}.Release|Any CPU.ActiveCfg = Release|Any CPU
49+
{E267C25B-98EA-4872-9753-4F6B22F7CA24}.Release|Any CPU.Build.0 = Release|Any CPU
50+
{9D1F91E1-B319-4914-B09B-60070C5531C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51+
{9D1F91E1-B319-4914-B09B-60070C5531C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
52+
{9D1F91E1-B319-4914-B09B-60070C5531C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
53+
{9D1F91E1-B319-4914-B09B-60070C5531C7}.Release|Any CPU.Build.0 = Release|Any CPU
4254
EndGlobalSection
4355
GlobalSection(SolutionProperties) = preSolution
4456
HideSolutionNode = FALSE

src/CLU/Commands.Common.Authentication/ClientFactory.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,25 @@ public virtual TClient CreateArmClient<TClient>(AzureContext context, AzureEnvir
8080

8181
public virtual TClient CreateCustomArmClient<TClient>(params object[] parameters) where TClient : Microsoft.Rest.ServiceClient<TClient>
8282
{
83+
var handlers = new List<DelegatingHandler>();
84+
var newParameters = new List<object>();
8385
List<Type> types = new List<Type>();
8486
foreach (object obj in parameters)
8587
{
86-
types.Add(obj.GetType());
88+
if (obj is DelegatingHandler)
89+
{
90+
handlers.Add(obj as DelegatingHandler);
91+
}
92+
else
93+
{
94+
types.Add(obj.GetType());
95+
newParameters.Add(obj);
96+
}
8797
}
98+
99+
types.Add(typeof (DelegatingHandler[]));
100+
newParameters.Add(handlers.ToArray());
101+
88102

89103
var constructor = typeof(TClient).GetConstructor(types.ToArray());
90104

@@ -93,7 +107,7 @@ public virtual TClient CreateCustomArmClient<TClient>(params object[] parameters
93107
throw new InvalidOperationException(string.Format(Resources.InvalidManagementClientType, typeof(TClient).Name));
94108
}
95109

96-
TClient client = (TClient)constructor.Invoke(parameters);
110+
TClient client = (TClient)constructor.Invoke(newParameters.ToArray());
97111

98112
foreach (ProductInfoHeaderValue userAgent in UserAgents)
99113
{

src/CLU/Commands.Common.Authentication/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"System.Reflection.Extensions": "4.0.1-beta-23516",
3232
"System.Reflection.Primitives": "4.0.1-beta-23516",
3333
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
34-
"System.Runtime": "4.0.20",
34+
"System.Runtime": "4.0.21-beta-23516",
3535
"System.Runtime.Extensions": "4.0.11-beta-23409",
3636
"System.Runtime.Serialization.Json": "4.0.1-beta-23409",
3737
"System.Runtime.Serialization.Primitives": "4.0.11-beta-23409",

src/CLU/Commands.Common/AzurePSCmdlet.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,20 @@ protected virtual bool IsErrorMetricEnabled
8484
public AzurePSCmdlet()
8585
{
8686
_debugMessages = new ConcurrentQueue<string>();
87-
// TODO: Instantiate ClientFactory and AuthenticationFactory
88-
// remove
89-
ClientFactory = new ClientFactory();
90-
AuthenticationFactory = new AuthenticationFactory();
9187
#if DEBUG
9288
if (!TestMockSupport.RunningMocked)
9389
{
9490
#endif
95-
DataStore = new DiskDataStore();
91+
DataStore = DataStore ?? new DiskDataStore();
9692
#if DEBUG
9793
}
9894
else
9995
{
100-
DataStore = new MemoryDataStore();
96+
DataStore = DataStore ?? new MemoryDataStore();
10197
}
10298
#endif
99+
AuthenticationFactory = AuthenticationFactory ?? new AuthenticationFactory(DataStore);
100+
ClientFactory = ClientFactory?? new ClientFactory(DataStore, AuthenticationFactory);
103101
}
104102

105103
protected virtual T GetSessionVariableValue<T>(string name, T defaultValue) where T : class
@@ -338,7 +336,11 @@ protected bool IsVerbose()
338336
protected new void WriteObject(object sendToPipeline)
339337
{
340338
FlushDebugMessages();
339+
#if DEBUG
340+
CommandRuntime.WriteObject(sendToPipeline);
341+
#else
341342
base.WriteObject(sendToPipeline);
343+
#endif
342344
}
343345

344346
protected new void WriteObject(object sendToPipeline, bool enumerateCollection)

src/CLU/Commands.Common/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"System.Reflection.Extensions": "4.0.1-beta-23516",
3232
"System.Reflection.Primitives": "4.0.1-beta-23516",
3333
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
34-
"System.Runtime": "4.0.20",
34+
"System.Runtime": "4.0.21-beta-23516",
3535
"System.Runtime.Extensions": "4.0.11-beta-23409",
3636
"System.Runtime.Serialization.Json": "4.0.1-beta-23409",
3737
"System.Runtime.Serialization.Xml": "4.0.11-beta-23409",

src/CLU/Commands.ResourceManager.Common/AzureRmCmdlet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected override void BeginProcessing()
5858
var sessionProfile = GetSessionVariableValue<PSAzureProfile>(AzurePowerShell.ProfileVariable, null);
5959
if (sessionProfile != null)
6060
{
61-
DefaultProfile = sessionProfile;
61+
DefaultProfile = DefaultProfile?? sessionProfile;
6262
}
6363
base.BeginProcessing();
6464
//TODO: Add back RP automatic registration

src/CLU/Commands.ResourceManager.Common/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"System.Reflection.Extensions": "4.0.1-beta-23516",
3333
"System.Reflection.Primitives": "4.0.1-beta-23516",
3434
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
35-
"System.Runtime": "4.0.20",
35+
"System.Runtime": "4.0.21-beta-23516",
3636
"System.Runtime.Extensions": "4.0.11-beta-23409",
3737
"System.Runtime.Serialization.Json": "4.0.1-beta-23409",
3838
"System.Runtime.Serialization.Xml": "4.0.11-beta-23409",

0 commit comments

Comments
 (0)