示例#1
0
 def save_sg_rule_mappings(self, session, firewall_rules):
     # REVISIT(roeyc): This method should take care db access only.
     rules = [(rule['display_name'], rule['id']) for rule in firewall_rules]
     with session.begin(subtransactions=True):
         for neutron_id, nsx_id in rules:
             mapping = nsx_models.NeutronNsxRuleMapping(
                 neutron_id=neutron_id, nsx_id=nsx_id)
             session.add(mapping)
     return mapping
示例#2
0
def save_sg_rule_mappings(session, rules):
    with session.begin(subtransactions=True):
        for neutron_id, nsx_id in rules:
            mapping = nsx_models.NeutronNsxRuleMapping(neutron_id=neutron_id,
                                                       nsx_id=nsx_id)
            session.add(mapping)