Skip to content

Handle invalid locations for Get-AzureRmResourceProvider. #2380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2016

Conversation

TianoMS
Copy link

@TianoMS TianoMS commented Jun 2, 2016

Fix issue #2218.

@TianoMS
Copy link
Author

TianoMS commented Jun 3, 2016

@hovsepm hovsepm merged commit 49fb96f into Azure:dev Jun 3, 2016
@@ -89,5 +91,38 @@ public override void ExecuteCmdlet()
this.WriteObject(providers, enumerateCollection: true);
}
}

private PSResourceProvider[] ListPSResourceProviders()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed PS stands for PowerShell, its good to call it ListPowerShellResourceProviders

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add summary

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PowerShell practice is in preference to PS abbreviation. For example, the base class PSObject, PSCustomObject. Here I think we can follow the practice.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PowerShell practice is in preference to PS abbreviation. For example, the base class PSObject, PSCustomObject. Here I think we can follow the practice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good


In reply to: 65991244 [](ancestors = 65991244)

@gandhiniraj
Copy link
Contributor

    /// Gets or sets the provider namespace

Not related to to PR, but I believe this was checked in few weeks ago - in correct summary


Refers to: src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Providers/GetAzureProviderCmdlet.cs:47 in 0c03564. [](commit_id = 0c03564, deletion_comment = False)

foreach (var provider in providers)
{
provider.ResourceTypes = provider.ResourceTypes
.Where(type => !type.Locations.Any() || type.Locations.Any(loc => loc.EqualsAsLocation(this.Location)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check type.Locations not null before type.Locations.Any()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants