Skip to content

Commit 625dc59

Browse files
committed
Merge pull request #1437 from shefaliv/hdi
HDInsight fixes
2 parents 47a3828 + 358eb8d commit 625dc59

File tree

5 files changed

+89
-82
lines changed

5 files changed

+89
-82
lines changed

src/ResourceManager/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@
5353
</Reference>
5454
<Reference Include="Microsoft.Azure.Management.HDInsight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5555
<SpecificVersion>False</SpecificVersion>
56-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.8-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
56+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.9-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
5757
</Reference>
5858
<Reference Include="Microsoft.Azure.Management.HDInsight.Job, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5959
<SpecificVersion>False</SpecificVersion>
60-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.Job.1.0.6-preview\lib\net40\Microsoft.Azure.Management.HDInsight.Job.dll</HintPath>
60+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.Job.1.0.7-preview\lib\net40\Microsoft.Azure.Management.HDInsight.Job.dll</HintPath>
6161
</Reference>
6262
<Reference Include="Microsoft.Azure.Management.Storage">
6363
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>

src/ResourceManager/HDInsight/Commands.HDInsight.Test/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
77
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Authorization" version="0.18.2-preview" targetFramework="net45" />
9-
<package id="Microsoft.Azure.Management.HDInsight" version="1.0.8-preview" targetFramework="net45" />
10-
<package id="Microsoft.Azure.Management.HDInsight.Job" version="1.0.6-preview" targetFramework="net45" />
9+
<package id="Microsoft.Azure.Management.HDInsight" version="1.0.9-preview" targetFramework="net45" />
10+
<package id="Microsoft.Azure.Management.HDInsight.Job" version="1.0.7-preview" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Resources" version="2.18.0-preview" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Management.Storage" version="2.4.0-preview" targetFramework="net45" />
1313
<package id="Microsoft.Azure.Test.Framework" version="1.0.5799.28345-prerelease" targetFramework="net45" />

src/ResourceManager/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@
117117
<Reference Include="Microsoft.Azure.Graph.RBAC">
118118
<HintPath>..\..\..\packages\Microsoft.Azure.Graph.RBAC.1.7.0-preview\lib\net40\Microsoft.Azure.Graph.RBAC.dll</HintPath>
119119
</Reference>
120-
<Reference Include="Microsoft.Azure.Management.HDInsight">
120+
<Reference Include="Microsoft.Azure.Management.HDInsight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
121121
<SpecificVersion>False</SpecificVersion>
122-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.8-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
122+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.9-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
123123
</Reference>
124124
<Reference Include="Microsoft.Azure.Management.HDInsight.Job, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
125125
<SpecificVersion>False</SpecificVersion>
126-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.Job.1.0.6-preview\lib\net40\Microsoft.Azure.Management.HDInsight.Job.dll</HintPath>
126+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.Job.1.0.7-preview\lib\net40\Microsoft.Azure.Management.HDInsight.Job.dll</HintPath>
127127
</Reference>
128128
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
129129
<SpecificVersion>False</SpecificVersion>

src/ResourceManager/HDInsight/Commands.HDInsight/ManagementCommands/NewAzureHDInsightClusterCommand.cs

Lines changed: 80 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,83 @@ public string DefaultStorageAccountKey
9797
set { parameters.DefaultStorageAccountKey = value; }
9898
}
9999

100+
[Parameter(ValueFromPipeline = true,
101+
HelpMessage = "The HDInsight cluster configuration to use when creating the new cluster.")]
102+
public AzureHDInsightConfig Config
103+
{
104+
get
105+
{
106+
var result = new AzureHDInsightConfig
107+
{
108+
ClusterType = parameters.ClusterType,
109+
DefaultStorageAccountName = parameters.DefaultStorageAccountName,
110+
DefaultStorageAccountKey = parameters.DefaultStorageAccountKey,
111+
WorkerNodeSize = parameters.WorkerNodeSize,
112+
HeadNodeSize = parameters.HeadNodeSize,
113+
ZookeeperNodeSize = parameters.ZookeeperNodeSize,
114+
HiveMetastore = HiveMetastore,
115+
OozieMetastore = OozieMetastore,
116+
ObjectId = ObjectId,
117+
AADTenantId = AadTenantId,
118+
CertificateFilePath = CertificateFilePath,
119+
CertificatePassword = CertificatePassword
120+
};
121+
foreach (
122+
var storageAccount in
123+
parameters.AdditionalStorageAccounts.Where(
124+
storageAccount => !result.AdditionalStorageAccounts.ContainsKey(storageAccount.Key)))
125+
{
126+
result.AdditionalStorageAccounts.Add(storageAccount.Key, storageAccount.Value);
127+
}
128+
foreach (var val in parameters.Configurations.Where(val => !result.Configurations.ContainsKey(val.Key)))
129+
{
130+
result.Configurations.Add(val.Key, DictionaryToHashtable(val.Value));
131+
}
132+
foreach (var action in parameters.ScriptActions.Where(action => !result.ScriptActions.ContainsKey(action.Key)))
133+
{
134+
result.ScriptActions.Add(action.Key, action.Value.Select(a => new AzureHDInsightScriptAction(a)).ToList());
135+
}
136+
return result;
137+
}
138+
set
139+
{
140+
parameters.ClusterType = value.ClusterType;
141+
if (parameters.DefaultStorageAccountName == null)
142+
{
143+
parameters.DefaultStorageAccountName = value.DefaultStorageAccountName;
144+
}
145+
if (parameters.DefaultStorageAccountKey == null)
146+
{
147+
parameters.DefaultStorageAccountKey = value.DefaultStorageAccountKey;
148+
}
149+
parameters.WorkerNodeSize = value.WorkerNodeSize;
150+
parameters.HeadNodeSize = value.HeadNodeSize;
151+
parameters.ZookeeperNodeSize = value.ZookeeperNodeSize;
152+
HiveMetastore = value.HiveMetastore;
153+
OozieMetastore = value.OozieMetastore;
154+
CertificateFilePath = value.CertificateFilePath;
155+
AadTenantId = value.AADTenantId;
156+
ObjectId = value.ObjectId;
157+
CertificatePassword = value.CertificatePassword;
158+
159+
foreach (
160+
var storageAccount in
161+
value.AdditionalStorageAccounts.Where(
162+
storageAccount => !parameters.AdditionalStorageAccounts.ContainsKey(storageAccount.Key)))
163+
{
164+
parameters.AdditionalStorageAccounts.Add(storageAccount.Key, storageAccount.Value);
165+
}
166+
foreach (var val in value.Configurations.Where(val => !parameters.Configurations.ContainsKey(val.Key)))
167+
{
168+
parameters.Configurations.Add(val.Key, HashtableToDictionary(val.Value));
169+
}
170+
foreach (var action in value.ScriptActions.Where(action => !parameters.ScriptActions.ContainsKey(action.Key)))
171+
{
172+
parameters.ScriptActions.Add(action.Key, action.Value.Select(a => a.GetScriptActionFromPSModel()).ToList());
173+
}
174+
}
175+
}
176+
100177
[Parameter(HelpMessage = "Gets or sets the database to store the metadata for Oozie.")]
101178
public AzureHDInsightMetastore OozieMetastore { get; set; }
102179

@@ -203,76 +280,6 @@ public DateTime RdpAccessExpiry
203280
[Parameter(HelpMessage = "Gets or sets the Service Principal AAD Tenant Id for accessing Azure Data Lake.", ParameterSetName = "ServicePrincipal")]
204281
public Guid AadTenantId { get; set; }
205282

206-
[Parameter(ValueFromPipeline = true,
207-
HelpMessage = "The HDInsight cluster configuration to use when creating the new cluster.")]
208-
public AzureHDInsightConfig Config {
209-
get
210-
{
211-
var result = new AzureHDInsightConfig
212-
{
213-
ClusterType = parameters.ClusterType,
214-
DefaultStorageAccountName = parameters.DefaultStorageAccountName,
215-
DefaultStorageAccountKey = parameters.DefaultStorageAccountKey,
216-
WorkerNodeSize = parameters.WorkerNodeSize,
217-
HeadNodeSize = parameters.HeadNodeSize,
218-
ZookeeperNodeSize = parameters.ZookeeperNodeSize,
219-
HiveMetastore = HiveMetastore,
220-
OozieMetastore = OozieMetastore,
221-
ObjectId = ObjectId,
222-
AADTenantId = AadTenantId,
223-
CertificateFilePath = CertificateFilePath,
224-
CertificatePassword = CertificatePassword
225-
};
226-
foreach (
227-
var storageAccount in
228-
parameters.AdditionalStorageAccounts.Where(
229-
storageAccount => !result.AdditionalStorageAccounts.ContainsKey(storageAccount.Key)))
230-
{
231-
result.AdditionalStorageAccounts.Add(storageAccount.Key, storageAccount.Value);
232-
}
233-
foreach (var val in parameters.Configurations.Where(val => !result.Configurations.ContainsKey(val.Key)))
234-
{
235-
result.Configurations.Add(val.Key, DictionaryToHashtable(val.Value));
236-
}
237-
foreach (var action in parameters.ScriptActions.Where(action => !result.ScriptActions.ContainsKey(action.Key)))
238-
{
239-
result.ScriptActions.Add(action.Key, action.Value.Select(a => new AzureHDInsightScriptAction(a)).ToList());
240-
}
241-
return result;
242-
}
243-
set
244-
{
245-
parameters.ClusterType = value.ClusterType;
246-
parameters.DefaultStorageAccountName = value.DefaultStorageAccountName;
247-
parameters.DefaultStorageAccountKey = value.DefaultStorageAccountKey;
248-
parameters.WorkerNodeSize = value.WorkerNodeSize;
249-
parameters.HeadNodeSize = value.HeadNodeSize;
250-
parameters.ZookeeperNodeSize = value.ZookeeperNodeSize;
251-
HiveMetastore = value.HiveMetastore;
252-
OozieMetastore = value.OozieMetastore;
253-
CertificateFilePath = value.CertificateFilePath;
254-
AadTenantId = value.AADTenantId;
255-
ObjectId = value.ObjectId;
256-
CertificatePassword = value.CertificatePassword;
257-
258-
foreach (
259-
var storageAccount in
260-
value.AdditionalStorageAccounts.Where(
261-
storageAccount => !parameters.AdditionalStorageAccounts.ContainsKey(storageAccount.Key)))
262-
{
263-
parameters.AdditionalStorageAccounts.Add(storageAccount.Key, storageAccount.Value);
264-
}
265-
foreach (var val in value.Configurations.Where(val => !parameters.Configurations.ContainsKey(val.Key)))
266-
{
267-
parameters.Configurations.Add(val.Key, HashtableToDictionary(val.Value));
268-
}
269-
foreach (var action in value.ScriptActions.Where(action => !parameters.ScriptActions.ContainsKey(action.Key)))
270-
{
271-
parameters.ScriptActions.Add(action.Key, action.Value.Select(a => a.GetScriptActionFromPSModel()).ToList());
272-
}
273-
}
274-
}
275-
276283
#endregion
277284

278285

@@ -336,9 +343,9 @@ var storageAccount in
336343
}
337344
if (CertificateFilePath != null && CertificatePassword != null)
338345
{
339-
Microsoft.Azure.Management.HDInsight.Models.ServicePrincipal servicePrincipal =
340-
new Microsoft.Azure.Management.HDInsight.Models.ServicePrincipal(
341-
GetApplicationId(), GetTenantId(AadTenantId), File.ReadAllBytes(CertificateFilePath), CertificatePassword);
346+
var servicePrincipal = new Management.HDInsight.Models.ServicePrincipal(
347+
GetApplicationId(), GetTenantId(AadTenantId), File.ReadAllBytes(CertificateFilePath),
348+
CertificatePassword);
342349
parameters.Principal = servicePrincipal;
343350
}
344351

src/ResourceManager/HDInsight/Commands.HDInsight/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<package id="Microsoft.Azure.Common.Authentication" version="1.4.1-preview" targetFramework="net45" />
66
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
77
<package id="Microsoft.Azure.Graph.RBAC" version="1.7.0-preview" targetFramework="net45" />
8-
<package id="Microsoft.Azure.Management.HDInsight" version="1.0.8-preview" targetFramework="net45" />
9-
<package id="Microsoft.Azure.Management.HDInsight.Job" version="1.0.6-preview" targetFramework="net45" />
8+
<package id="Microsoft.Azure.Management.HDInsight" version="1.0.9-preview" targetFramework="net45" />
9+
<package id="Microsoft.Azure.Management.HDInsight.Job" version="1.0.7-preview" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5799.28345-prerelease" targetFramework="net45" />
1212
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />

0 commit comments

Comments
 (0)