Exemplo n.º 1
0
def save_sg_mappings(context, sg_id, nsgroup_id, section_id):
    context.session.add(
        nsx_models.NeutronNsxFirewallSectionMapping(neutron_id=sg_id,
                                                    nsx_id=section_id))
    context.session.add(
        nsx_models.NeutronNsxSecurityGroupMapping(neutron_id=sg_id,
                                                  nsx_id=nsgroup_id))
Exemplo n.º 2
0
def save_sg_mappings(session, sg_id, nsgroup_id, section_id):
    with session.begin(subtransactions=True):
        session.add(
            nsx_models.NeutronNsxFirewallSectionMapping(neutron_id=sg_id,
                                                        nsx_id=section_id))
        session.add(
            nsx_models.NeutronNsxSecurityGroupMapping(neutron_id=sg_id,
                                                      nsx_id=nsgroup_id))