Conversation
| } | ||
| if (privateEndPort != null) { | ||
| rule.setDestinationPortStart((privatePort == null) ? privateEndPort.intValue() : privatePort.intValue()); | ||
| rule.setDestinationPortEnd(privateEndPort); |
There was a problem hiding this comment.
This line is not needed. It would have got set already
There was a problem hiding this comment.
This line is for the case when privatePort is null and privateEndPort is not null. Rather else part in conditional if(privateEndport == null) can be removed
There was a problem hiding this comment.
However, above two can be combined into one "if else" with nested conditions to avoid any duplicate statements
| rule.setDestinationPortEnd((privateEndPort == null) ? privatePort.intValue() : privateEndPort.intValue()); | ||
| } | ||
| if (privateEndPort != null) { | ||
| rule.setDestinationPortStart((privatePort == null) ? privateEndPort.intValue() : privatePort.intValue()); |
There was a problem hiding this comment.
else of part of conditional is redundant. already taken care in previous if
There was a problem hiding this comment.
Agreed, will remove it
yvsubhash
left a comment
There was a problem hiding this comment.
two successive ifs can be written like this
if (privatePort != null) { rule.setDestinationPortStart(privatePort.intValue());
rule.setDestinationPortEnd((privateEndPort == null) ? privatePort.intValue() : privateEndPort.intValue());
}
else if (privateEndPort != null) {
rule.setDestinationPortStart( privateEndPort.intValue());
rule.setDestinationPortEnd(privateEndPort);
}
|
Done, please check |
|
Code LGTM |
|
tag:This is Ready to Merge |
| from marvin.codes import PASS | ||
| from nose.plugins.attrib import attr | ||
|
|
||
| class TestPortForwardingRules(cloudstackTestCase): |
There was a problem hiding this comment.
If this test is rather quick, move it to smoke please.
…tional parameter end port
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no): https://www.dropbox.com/sh/r2si930m8xxzavs/AAAzNrnoF1fC3auFrvsKo_8-a?dl=0 Failed tests:
Skipped tests: Passed test suits: |
|
LGTM for Testing |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1045 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1457)
|
|
LGTM, no new regressions found. The errors are known intermittent failures, being handled separately. @summary: Test to list, create and delete Port Forwarding for ... === TestName: test_01_create_delete_portforwarding_fornonvpc | Status : SUCCESS === Ran 1 test in 253.043s OK |

Configure a PF rule Private port : Start port ; 20 ENd POrt 25 || Public Port : Start port 20 ; ENd Port : 25.
Trigger UpdatePortForwardingRule api
ApI fails with following error : " Unable to update the private port of port forwarding rule as the rule has port range "
Solution-
Port range gets modified