File tree Expand file tree Collapse file tree
server/src/main/java/com/cloud/network/firewall Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030import javax .inject .Inject ;
3131import javax .naming .ConfigurationException ;
3232
33+ import com .cloud .network .vpc .Vpc ;
3334import com .cloud .network .vpc .VpcOfferingVO ;
3435import com .cloud .network .vpc .dao .VpcOfferingDao ;
3536import 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
You can’t perform that action at this time.
0 commit comments