cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] rhtyd commented on a change in pull request #2048: CLOUDSTACK-9880: Expansion of Management IP Range.
Date Thu, 01 Jan 1970 00:00:00 GMT
rhtyd commented on a change in pull request #2048: CLOUDSTACK-9880: Expansion of Management
IP Range.
URL: https://github.com/apache/cloudstack/pull/2048#discussion_r148809330
 
 

 ##########
 File path: server/src/com/cloud/configuration/ConfigurationManagerImpl.java
 ##########
 @@ -1097,8 +1095,243 @@ public void doInTransactionWithoutResult(final TransactionStatus
status) {
     }
 
     @Override
+    @DB
+    public Pod createPodIpRange(final CreateManagementNetworkIpRangeCmd cmd) {
+
+        //Check if calling account is root admin.
+        final Account account = CallContext.current().getCallingAccount();
+
+        if(!_accountMgr.isRootAdmin(account.getId())) {
+            throw new PermissionDeniedException("Cannot perform this operation, Calling account
is not root admin: " + account.getId());
+        }
+
+        final long podId = cmd.getPodId();
+        final String gateway = cmd.getGateWay();
+        final String netmask = cmd.getNetmask();
+        final String startIp = cmd.getStartIp();
+        String endIp = cmd.getEndIp();
+
+        final HostPodVO pod = _podDao.findById(podId);
+
+        if(pod == null) {
+            throw new InvalidParameterValueException("Unable to find pod by ID: " + podId);
+        }
+
+        final long zoneId = pod.getDataCenterId();
+
+        //Check if gateway is a valid IP address.
+        if(!NetUtils.isValidIp(gateway)) {
+            throw new InvalidParameterValueException("The gateway IP address is invalid.");
+        }
+
+        //Check if netmask is valid.
 
 Review comment:
   Remove comments, they tell what the code is trying to do (redundancy)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message