vmware-archive / powernsx

PowerShell module that abstracts the VMware NSX-v API to a set of easily used PowerShell functions
173 stars 90 forks source link

Fixing bug in New-NsxLoadBalancerApplicationRule #610

Closed Nick-Andreev closed 3 years ago

Nick-Andreev commented 4 years ago

Fixing bug in New-NsxLoadBalancerApplicationRule and adding corresponding LB test "Load Balancer App Rule".

This is the error returned by the New-NsxLoadBalancerApplicationRule when creating a LB application rule:

RuntimeException: The variable '$_LoadBalancer' cannot be retrieved because it has not been set.
        at New-NsxLoadBalancerApplicationRule<Process>, PowerNSX.psm1: line 32186
        at Get-NsxLoadBalancer<Process>, PowerNSX.psm1: line 30094
        at Get-NsxEdge, PowerNSX.psm1: line 13527

It looks like a typo, since the parameter passed to the function doesn't have the "_" in front of it.

I have added "Load Balancer App Rule" which reproduces the error and then demonstrates that this change fixes the issue.

alagoutte commented 4 years ago

Good catch !

LGTM @dcoghlan can you launch test suite ?

a new patch for add remove function ? :)