Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/src/main/java/com/cloud/api/ApiResponseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ public VlanIpRangeResponse createVlanIpRangeResponse(Class<? extends VlanIpRange
Long networkId = vlan.getNetworkId();
if (networkId != null) {
Network network = _ntwkModel.getNetwork(networkId);
if (network != null) {
if (network != null && TrafficType.Guest.equals(network.getTrafficType())) {
Long accountId = network.getAccountId();
populateAccount(vlanResponse, accountId);
populateDomain(vlanResponse, ApiDBUtils.findAccountById(accountId).getDomainId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5318,10 +5318,11 @@ public Vlan dedicatePublicIpRange(final DedicatePublicIpRangeCmd cmd) throws Res

// Check if any of the Public IP addresses is allocated to another
// account
boolean forSystemVms = false;
final List<IPAddressVO> ips = _publicIpAddressDao.listByVlanId(vlanDbId);
for (final IPAddressVO ip : ips) {
forSystemVms = ip.isForSystemVms();
if (ip.isForSystemVms()) {
throw new InvalidParameterValueException(ip.getAddress() + " Public IP address in range is dedicated to system vms ");
}
final Long allocatedToAccountId = ip.getAllocatedToAccountId();
if (allocatedToAccountId != null) {
if (vlanOwner != null && allocatedToAccountId != vlanOwner.getId()) {
Expand All @@ -5346,7 +5347,7 @@ public Vlan dedicatePublicIpRange(final DedicatePublicIpRangeCmd cmd) throws Res
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NET_IP_ASSIGN, vlanOwner.getId(), ip.getDataCenterId(), ip.getId(), ip.getAddress().toString(), ip.isSourceNat(),
vlan.getVlanType().toString(), ip.getSystem(), usageHidden, ip.getClass().getName(), ip.getUuid());
}
} else if (domain != null && !forSystemVms) {
} else if (domain != null) {
// Create an DomainVlanMapVO entry
DomainVlanMapVO domainVlanMapVO = new DomainVlanMapVO(domain.getId(), vlan.getId());
_domainVlanMapDao.persist(domainVlanMapVO);
Expand Down Expand Up @@ -7164,7 +7165,6 @@ public Account getVlanAccount(final long vlanId) {
@Override
public Domain getVlanDomain(long vlanId) {
Vlan vlan = _vlanDao.findById(vlanId);
Long domainId = null;

// if vlan is Virtual Domain specific, get vlan information from the
// accountVlanMap; otherwise get account information
Expand Down
Loading