You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2017/11/03 15:13:05 UTC
[GitHub] rhtyd commented on a change in pull request #2048: CLOUDSTACK-9880: Expansion of Management IP Range.
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