yvsubhash commented on a change in pull request #1985: CLOUDSTACK-9812:Update
"updatePortForwardingRule" api to include additional parameter to update the
end port in case of port range
URL: https://github.com/apache/cloudstack/pull/1985#discussion_r115942739
##########
File path: server/src/com/cloud/network/rules/RulesManagerImpl.java
##########
@@ -1578,8 +1593,13 @@ public PortForwardingRule updatePortForwardingRule(long
id, Integer privatePort,
rule.setState(State.Add);
if (privatePort != null) {
rule.setDestinationPortStart(privatePort.intValue());
- rule.setDestinationPortEnd(privatePort.intValue());
+ rule.setDestinationPortEnd((privateEndPort == null) ?
privatePort.intValue() : privateEndPort.intValue());
+ }
+ if (privateEndPort != null) {
+ rule.setDestinationPortStart((privatePort == null) ?
privateEndPort.intValue() : privatePort.intValue());
+ rule.setDestinationPortEnd(privateEndPort);
Review comment:
However, above two can be combine into one "if else" with nested conditons
to avoid any duplicate statements
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services