-
Notifications
You must be signed in to change notification settings - Fork 3
AzureRT: Fix Get-AzureVM #19
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
Changes from all commits
1f907c5
f01a80b
5215cff
6a8537b
a3dff8c
5ff031e
9cb068d
0ae3559
459241b
616fd09
30479b9
43ef387
b2311fb
dcbf944
a67e9f6
e2b86ac
f7ece7b
4b2da43
bb43e0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,14 +101,18 @@ protected override void ExecuteCommand() | |
private List<T> GetVMContextList<T>(string serviceName, NSM.DeploymentGetResponse deployment) | ||
where T : PVM.PersistentVMRoleContext, new() | ||
{ | ||
var vmRoles = new List<NSM.Role>(deployment.Roles.Where( | ||
r => string.IsNullOrEmpty(Name) | ||
|| r.RoleName.Equals(Name, StringComparison.InvariantCultureIgnoreCase))); | ||
Func<NSM.Role, bool> typeMatched = | ||
r => string.Equals(r.RoleType, PersistentVMRoleStr, StringComparison.OrdinalIgnoreCase); | ||
|
||
return GetVMContextList<T>(serviceName, deployment, vmRoles); | ||
Func<NSM.Role, bool> nameMatched = | ||
r => string.IsNullOrEmpty(this.Name) || r.RoleName.Equals(this.Name, StringComparison.InvariantCultureIgnoreCase); | ||
|
||
var vmRoles = new List<NSM.Role>(deployment.Roles.Where(r => typeMatched(r) && nameMatched(r))); | ||
|
||
return CreateVMContextList<T>(serviceName, deployment, vmRoles); | ||
} | ||
|
||
private List<T> GetVMContextList<T>(string serviceName, NSM.DeploymentGetResponse deployment, List<NSM.Role> vmRoles) | ||
private List<T> CreateVMContextList<T>(string serviceName, NSM.DeploymentGetResponse deployment, List<NSM.Role> vmRoles) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you change this method name? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to fix the function name so that it matches what it's doing. |
||
where T : PVM.PersistentVMRoleContext, new() | ||
{ | ||
var roleContexts = new List<T>(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it StringComparison.OrdinalIgnoreCase instead of StringComparison.InvariantCultureIgnoreCase ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are only handling ASCII characters, so I think the
StringComparison.OrdinalIgnoreCase
one is enough.