shwstppr commented on code in PR #6748:
URL: https://github.com/apache/cloudstack/pull/6748#discussion_r1066920037
##########
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java:
##########
@@ -6614,25 +6614,26 @@ public Pair<List<? extends NetworkOffering>, Integer>
searchForNetworkOfferings(
ListIterator<NetworkOfferingJoinVO> it = offerings.listIterator();
while (it.hasNext()) {
NetworkOfferingJoinVO offering = it.next();
- if (StringUtils.isNotEmpty(offering.getDomainId())) {
- boolean toRemove = false;
- String[] domainIdsArray =
offering.getDomainId().split(",");
- for (String domainIdString : domainIdsArray) {
- Long dId = Long.valueOf(domainIdString.trim());
- if (caller.getType() != Account.Type.ADMIN &&
- !_domainDao.isChildDomain(dId,
caller.getDomainId())) {
- toRemove = true;
- break;
- }
- if (domainId != null && !_domainDao.isChildDomain(dId,
domainId)) {
- toRemove = true;
- break;
- }
+ if (StringUtils.isEmpty(offering.getDomainId())) {
+ continue;
+ }
+ boolean toRemove = true;
+ String[] domainIdsArray = offering.getDomainId().split(",");
+ for (String domainIdString : domainIdsArray) {
+ Long dId = Long.valueOf(domainIdString.trim());
+ if (caller.getType() != Account.Type.ADMIN &&
+ _domainDao.isChildDomain(dId,
caller.getDomainId())) {
+ toRemove = false;
Review Comment:
done
##########
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java:
##########
@@ -6614,25 +6614,26 @@ public Pair<List<? extends NetworkOffering>, Integer>
searchForNetworkOfferings(
ListIterator<NetworkOfferingJoinVO> it = offerings.listIterator();
while (it.hasNext()) {
NetworkOfferingJoinVO offering = it.next();
- if (StringUtils.isNotEmpty(offering.getDomainId())) {
- boolean toRemove = false;
- String[] domainIdsArray =
offering.getDomainId().split(",");
- for (String domainIdString : domainIdsArray) {
- Long dId = Long.valueOf(domainIdString.trim());
- if (caller.getType() != Account.Type.ADMIN &&
- !_domainDao.isChildDomain(dId,
caller.getDomainId())) {
- toRemove = true;
- break;
- }
- if (domainId != null && !_domainDao.isChildDomain(dId,
domainId)) {
- toRemove = true;
- break;
- }
+ if (StringUtils.isEmpty(offering.getDomainId())) {
+ continue;
+ }
+ boolean toRemove = true;
+ String[] domainIdsArray = offering.getDomainId().split(",");
+ for (String domainIdString : domainIdsArray) {
+ Long dId = Long.valueOf(domainIdString.trim());
+ if (caller.getType() != Account.Type.ADMIN &&
+ _domainDao.isChildDomain(dId,
caller.getDomainId())) {
+ toRemove = false;
+ break;
}
- if (toRemove) {
- it.remove();
+ if (domainId != null && _domainDao.isChildDomain(dId,
domainId)) {
+ toRemove = false;
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]