rafaelweingartner commented on a change in pull request #2773: 
CLOUDSTACK-10328: Add Secondary IPv6 address through API
URL: https://github.com/apache/cloudstack/pull/2773#discussion_r205416258
 
 

 ##########
 File path: 
api/src/main/java/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java
 ##########
 @@ -147,10 +147,15 @@ public void execute() throws 
InvalidParameterValueException {
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Invalid 
IP id is passed");
         }
 
+        String secIp = nicSecIp.getIp4Address();
+        if (secIp == null) {
+            secIp = nicSecIp.getIp6Address();
+        }
+
         if (isZoneSGEnabled()) {
             //remove the security group rules for this secondary ip
             boolean success = false;
-            success = 
_securityGroupService.securityGroupRulesForVmSecIp(nicSecIp.getNicId(), 
nicSecIp.getIp4Address(), false);
+            success = 
_securityGroupService.securityGroupRulesForVmSecIp(nicSecIp.getNicId(), secIp, 
false);
 
 Review comment:
   Instead of sending the parameters what about using the command POJO?

----------------------------------------------------------------
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

Reply via email to