@@ -3652,9 +3652,9 @@ public boolean deleteVlanAndPublicIpRange(final long userId, final long vlanDbId
36523652 }
36533653
36543654 boolean isDomainSpecific = false ;
3655- List <DomainVlanMapVO > domainVln = _domainVlanMapDao .listDomainVlanMapsByVlan (vlanRange .getId ());
3655+ List <DomainVlanMapVO > domainVlan = _domainVlanMapDao .listDomainVlanMapsByVlan (vlanRange .getId ());
36563656 // Check for domain wide pool. It will have an entry for domain_vlan_map.
3657- if (domainVln != null && !domainVln .isEmpty ()) {
3657+ if (domainVlan != null && !domainVlan .isEmpty ()) {
36583658 isDomainSpecific = true ;
36593659 }
36603660
@@ -3811,10 +3811,10 @@ public Vlan dedicatePublicIpRange(final DedicatePublicIpRangeCmd cmd) throws Res
38113811 forSystemVms = ip .isForSystemVms ();
38123812 final Long allocatedToAccountId = ip .getAllocatedToAccountId ();
38133813 if (allocatedToAccountId != null ) {
3814- final Account accountAllocatedTo = _accountMgr .getActiveAccountById (allocatedToAccountId );
3815- if (!accountAllocatedTo .getAccountName ().equalsIgnoreCase (accountName )) {
3814+ if (vlanOwner != null && allocatedToAccountId != vlanOwner .getId ()) {
38163815 throw new InvalidParameterValueException (ip .getAddress () + " Public IP address in range is allocated to another account " );
38173816 }
3817+ final Account accountAllocatedTo = _accountMgr .getActiveAccountById (allocatedToAccountId );
38183818 if (vlanOwner == null && domain != null && domain .getId () != accountAllocatedTo .getDomainId ()){
38193819 throw new InvalidParameterValueException (ip .getAddress ()
38203820 + " Public IP address in range is allocated to another domain/account " );
@@ -3875,9 +3875,9 @@ public boolean releasePublicIpRange(final long vlanDbId, final long userId, fina
38753875 }
38763876
38773877 boolean isDomainSpecific = false ;
3878- final List <DomainVlanMapVO > domainVln = _domainVlanMapDao .listDomainVlanMapsByVlan (vlanDbId );
3878+ final List <DomainVlanMapVO > domainVlan = _domainVlanMapDao .listDomainVlanMapsByVlan (vlanDbId );
38793879 // Check for domain wide pool. It will have an entry for domain_vlan_map.
3880- if (domainVln != null && !domainVln .isEmpty ()) {
3880+ if (domainVlan != null && !domainVlan .isEmpty ()) {
38813881 isDomainSpecific = true ;
38823882 }
38833883
@@ -3930,7 +3930,7 @@ public boolean releasePublicIpRange(final long vlanDbId, final long userId, fina
39303930 // decrement resource count for dedicated public ip's
39313931 _resourceLimitMgr .decrementResourceCount (acctVln .get (0 ).getAccountId (), ResourceType .public_ip , new Long (ips .size ()));
39323932 return true ;
3933- } else if (isDomainSpecific && _domainVlanMapDao .remove (domainVln .get (0 ).getId ())) {
3933+ } else if (isDomainSpecific && _domainVlanMapDao .remove (domainVlan .get (0 ).getId ())) {
39343934 s_logger .debug ("Remove the vlan from domain_vlan_map successfully." );
39353935 return true ;
39363936 } else {
0 commit comments