Skip to content

Commit 3772560

Browse files
committed
Fix VPC search on detectRulesConflict
1 parent 45eba18 commit 3772560

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

server/src/main/java/com/cloud/network/firewall/FirewallManagerImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import javax.inject.Inject;
3131
import javax.naming.ConfigurationException;
3232

33+
import com.cloud.network.vpc.Vpc;
3334
import com.cloud.network.vpc.VpcOfferingVO;
3435
import com.cloud.network.vpc.dao.VpcOfferingDao;
3536
import org.apache.commons.lang3.ObjectUtils;
@@ -406,7 +407,8 @@ public void detectRulesConflict(FirewallRule newRule) throws NetworkRuleConflict
406407
boolean isNewRuleOnVpcNetwork = newRuleNetwork.getVpcId() != null;
407408
boolean isVpcConserveModeEnabled = false;
408409
if (isNewRuleOnVpcNetwork) {
409-
VpcOfferingVO vpcOffering = vpcOfferingDao.findById(newRuleNetwork.getVpcId());
410+
Vpc vpc = _vpcMgr.getActiveVpc(newRuleNetwork.getVpcId());
411+
VpcOfferingVO vpcOffering = vpc != null ? vpcOfferingDao.findById(vpc.getVpcOfferingId()) : null;
410412
isVpcConserveModeEnabled = vpcOffering != null && vpcOffering.isConserveMode();
411413
}
412414

0 commit comments

Comments
 (0)