Skip to content

Commit a1ddf30

Browse files
author
Hovsep
committed
Merge pull request Azure#2157 from independentwork/dev
Fix list intelligence packs so it returns a full list
2 parents 6ff1224 + f437cdc commit a1ddf30

File tree

7 files changed

+234
-234
lines changed

7 files changed

+234
-234
lines changed

src/ResourceManager/OperationalInsights/Commands.OperationalInsights.Test/Commands.OperationalInsights.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
<HintPath>..\..\..\packages\Microsoft.Azure.Gallery.2.6.2-preview\lib\net40\Microsoft.Azure.Gallery.dll</HintPath>
5959
</Reference>
6060
<Reference Include="Microsoft.Azure.Management.OperationalInsights, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
61-
<SpecificVersion>False</SpecificVersion>
62-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.OperationalInsights.0.11.0-preview\lib\net40\Microsoft.Azure.Management.OperationalInsights.dll</HintPath>
61+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.OperationalInsights.0.12.0-preview\lib\net40\Microsoft.Azure.Management.OperationalInsights.dll</HintPath>
62+
<Private>True</Private>
6363
</Reference>
6464
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6565
<SpecificVersion>False</SpecificVersion>

src/ResourceManager/OperationalInsights/Commands.OperationalInsights.Test/ScenarioTests/WorkspaceTests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ function Test-WorkspaceEnableDisableListIntelligencePacks
179179
{
180180
if (($ip.Name -eq "ChangeTracking") -or ($ip.Name -eq "SiteRecovery") -or ($ip.Name -eq "LogManagement"))
181181
{
182-
Assert-True $ip.Enabled
182+
Assert-AreEqual $ip.Enabled $true
183183
}
184184
else
185185
{
186-
Assert-False $ip.Enabled
186+
Assert-AreEqual $ip.Enabled $false
187187
}
188188
}
189189

@@ -197,11 +197,11 @@ function Test-WorkspaceEnableDisableListIntelligencePacks
197197
{
198198
if ($ip.Name -eq "LogManagement")
199199
{
200-
Assert-True $ip.Enabled
200+
Assert-AreEqual $ip.Enabled $true
201201
}
202202
else
203203
{
204-
Assert-False $ip.Enabled
204+
Assert-AreEqual $ip.Enabled $false
205205
}
206206
}
207207

src/ResourceManager/OperationalInsights/Commands.OperationalInsights.Test/SessionRecords/Microsoft.Azure.Commands.OperationalInsights.Test.WorkspaceTests/TestWorkspaceEnableDisableListIntelligencePacks.json

Lines changed: 219 additions & 219 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
66
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
77
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
8-
<package id="Microsoft.Azure.Management.OperationalInsights" version="0.11.0-preview" targetFramework="net45" />
8+
<package id="Microsoft.Azure.Management.OperationalInsights" version="0.12.0-preview" targetFramework="net45" />
99
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Test.Framework" version="1.0.5896.19355-prerelease" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5896.19355-prerelease" targetFramework="net45" />

src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Client/OperationalInsightsClient.Workspaces.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ public virtual List<PSIntelligencePack> GetIntelligencePackList(string resourceG
260260
List<PSIntelligencePack> intelligencePacks = new List<PSIntelligencePack>();
261261

262262
var listResponse = OperationalInsightsManagementClient.Workspaces.ListIntelligencePacks(resourceGroupName, workspaceName);
263-
if (listResponse != null)
263+
if (listResponse != null && listResponse.IntelligencePacks != null)
264264
{
265-
listResponse.ForEach(ip => intelligencePacks.Add(new PSIntelligencePack(ip.Name, ip.Enabled)));
265+
listResponse.IntelligencePacks.ForEach(ip => intelligencePacks.Add(new PSIntelligencePack(ip.Name, ip.Enabled)));
266266
}
267267

268268
return intelligencePacks;
@@ -272,12 +272,12 @@ public virtual PSIntelligencePack SetIntelligencePack(string resourceGroupName,
272272
{
273273
if (enabled)
274274
{
275-
OperationalInsightsManagementClient.Workspaces.EnableIntelligencePackAsync(resourceGroupName, workspaceName, intelligencePackName);
275+
OperationalInsightsManagementClient.Workspaces.EnableIntelligencePack(resourceGroupName, workspaceName, intelligencePackName);
276276
return new PSIntelligencePack(intelligencePackName, enabled); ;
277277
}
278278
else
279279
{
280-
OperationalInsightsManagementClient.Workspaces.DisableIntelligencePackAsync(resourceGroupName, workspaceName, intelligencePackName);
280+
OperationalInsightsManagementClient.Workspaces.DisableIntelligencePack(resourceGroupName, workspaceName, intelligencePackName);
281281
return new PSIntelligencePack(intelligencePackName, enabled);
282282
}
283283
}

src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Commands.OperationalInsights.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
<Reference Include="Microsoft.Azure.Common.NetFramework">
5858
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
5959
</Reference>
60-
<Reference Include="Microsoft.Azure.Management.OperationalInsights, Version=0.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
61-
<SpecificVersion>False</SpecificVersion>
62-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.OperationalInsights.0.11.0-preview\lib\net40\Microsoft.Azure.Management.OperationalInsights.dll</HintPath>
60+
<Reference Include="Microsoft.Azure.Management.OperationalInsights, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
61+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.OperationalInsights.0.12.0-preview\lib\net40\Microsoft.Azure.Management.OperationalInsights.dll</HintPath>
62+
<Private>True</Private>
6363
</Reference>
6464
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6565
<SpecificVersion>False</SpecificVersion>

src/ResourceManager/OperationalInsights/Commands.OperationalInsights/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<package id="Hyak.Common" version="1.0.3" targetFramework="net45" />
44
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
55
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
6-
<package id="Microsoft.Azure.Management.OperationalInsights" version="0.11.0-preview" targetFramework="net45" />
6+
<package id="Microsoft.Azure.Management.OperationalInsights" version="0.12.0-preview" targetFramework="net45" />
77
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
88
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
99
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />

0 commit comments

Comments
 (0)