def _check_unshared_rules_for_policy(self, fwp_db, fwp): if fwp['shared']: rules_in_db = fwp_db['firewall_rules'] for fwr_db in rules_in_db: if not fwr_db['shared']: raise firewall.FirewallPolicySharingConflict( firewall_rule_id=fwr_db['id'], firewall_policy_id=fwp_db['id'])
def _check_firewall_rule_conflict(self, fwr_db, fwp_db): if not fwr_db['shared']: if fwr_db['tenant_id'] != fwp_db['tenant_id']: raise firewall.FirewallRuleConflict( firewall_rule_id=fwr_db['id'], tenant_id=fwr_db['tenant_id']) if fwr_db['shared'] != fwp_db['shared']: raise firewall.FirewallPolicySharingConflict( firewall_rule_id=fwr_db['id'], firewall_policy_id=fwp_db['id'])