def _test_pnet_replay( self, auto_create, auto_trunk, is_provider_vlan=True): self._set_provider_configuration(auto_create, auto_trunk) self._is_provider_vlan_mock.return_value = is_provider_vlan port_bindings = nexus_models_v2.NexusPortBinding( port_id=PORT_ID, vlan_id=VLAN_ID, vni=NO_VNI, switch_ip=IP_ADDR, instance_id=0, is_native=False, channel_group=0) self._nexus_md.configure_switch_entries(IP_ADDR, [port_bindings])
def add_nexusport_binding(port_id, vlan_id, vni, switch_ip, instance_id, is_provider_vlan): """Adds a nexusport binding.""" LOG.debug("add_nexusport_binding() called") session = db.get_session() binding = nexus_models_v2.NexusPortBinding(port_id=port_id, vlan_id=vlan_id, vni=vni, switch_ip=switch_ip, instance_id=instance_id, is_provider_vlan=is_provider_vlan) session.add(binding) session.flush() return binding
def add_nexusport_binding(port_id, vlan_id, vni, switch_ip, instance_id, is_native=False, ch_grp=0): """Adds a nexusport binding.""" LOG.debug("add_nexusport_binding() called") session = bc.get_writer_session() binding = nexus_models_v2.NexusPortBinding(port_id=port_id, vlan_id=vlan_id, vni=vni, switch_ip=switch_ip, instance_id=instance_id, is_native=is_native, channel_group=ch_grp) session.add(binding) session.flush() return binding