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_r205415983
##########
File path:
api/src/main/java/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java
##########
@@ -169,17 +161,25 @@ public long getEntityOwnerId() {
@Override
public void create() throws ResourceAllocationException {
- String ip;
NicSecondaryIp result;
- String secondaryIp = null;
- if ((ip = getIpaddress()) != null) {
- if (!NetUtils.isValidIp4(ip)) {
- throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
"Invalid ip address " + ip);
+ boolean isIpv4 = true;
Review comment:
What about moving this validation to a "service" layer? This is the
"view/controller" part of the design. It should only receive the request, get
the data and dispatch to the service layer where the business gets done.
----------------------------------------------------------------
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