vmware-archive / powernsx

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

Fixing bug in New-NsxLoadBalancerApplicationRule #609

Closed Nick-Andreev closed 4 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.

vmwclabot commented 4 years ago

@Nick-Andreev, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.