Skip to content

Commit 28289db

Browse files
committed
fix AzureRT test issue
1 parent 64c136c commit 28289db

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,14 +1596,16 @@ public string GetAzureVMImageName(string[] keywords, bool exactMatch = true, int
15961596
Collection<SM.OSImageContext> vmImages = GetAzureVMImage();
15971597
foreach (SM.OSImageContext image in vmImages)
15981598
{
1599-
if (Utilities.MatchKeywords(image.ImageName, keywords, exactMatch) >= 0 &&
1600-
((diskSize == null) || (image.LogicalSizeInGB <= diskSize)))
1599+
if (Utilities.MatchKeywords(image.ImageName, keywords, exactMatch) >= 0
1600+
&& ((diskSize == null) || (image.LogicalSizeInGB <= diskSize))
1601+
&& image.Location.Contains(CredentialHelper.Location))
16011602
return image.ImageName;
16021603
}
16031604
foreach (SM.OSImageContext image in vmImages)
16041605
{
1605-
if (Utilities.MatchKeywords(image.OS, keywords, exactMatch) >= 0 &&
1606-
((diskSize == null) || (image.LogicalSizeInGB <= diskSize)))
1606+
if (Utilities.MatchKeywords(image.OS, keywords, exactMatch) >= 0
1607+
&& ((diskSize == null) || (image.LogicalSizeInGB <= diskSize))
1608+
&& image.Location.Contains(CredentialHelper.Location))
16071609
return image.ImageName;
16081610
}
16091611
return null;

0 commit comments

Comments
 (0)