"""
LOG.debug("LinuxBridgePlugin.get_all_ports() called")
db.validate_network_ownership(tenant_id, net_id)
- network = db.network_get(net_id)
ports_list = db.port_list(net_id)
ports_on_net = []
for port in ports_list:
"""
LOG.debug("LinuxBridgePlugin.get_port_details() called")
db.validate_port_ownership(tenant_id, net_id, port_id)
- network = db.network_get(net_id)
port = db.port_get(port_id, net_id)
new_port_dict = cutil.make_port_dict(port)
return new_port_dict
db.validate_network_ownership(tenant_id, net_id)
port = db.port_create(net_id, port_state,
op_status=OperationalStatus.DOWN)
- unique_port_id_string = port[const.UUID]
new_port_dict = cutil.make_port_dict(port)
return new_port_dict
"""
LOG.debug("LinuxBridgePlugin.update_port() called")
db.validate_port_ownership(tenant_id, net_id, port_id)
- network = db.network_get(net_id)
self._validate_port_state(kwargs["state"])
port = db.port_update(port_id, net_id, **kwargs)
"""
LOG.debug("LinuxBridgePlugin.delete_port() called")
db.validate_port_ownership(tenant_id, net_id, port_id)
- network = db.network_get(net_id)
port = db.port_get(port_id, net_id)
attachment_id = port[const.INTERFACEID]
if not attachment_id:
"""
LOG.debug("LinuxBridgePlugin.plug_interface() called")
db.validate_port_ownership(tenant_id, net_id, port_id)
- network = db.network_get(net_id)
port = db.port_get(port_id, net_id)
attachment_id = port[const.INTERFACEID]
if attachment_id:
"""
LOG.debug("LinuxBridgePlugin.unplug_interface() called")
db.validate_port_ownership(tenant_id, net_id, port_id)
- network = db.network_get(net_id)
port = db.port_get(port_id, net_id)
attachment_id = port[const.INTERFACEID]
if attachment_id == None:
- raise exc.InvalidDetach(port_id=port_id, net_id=net_id,
- att_id=remote_interface_id)
+ return
db.port_unset_attachment(port_id, net_id)
db.port_update(port_id, net_id, op_status=OperationalStatus.DOWN)
LOG.debug("test_test_process_unplugged_tap_interface -END")
+ def test_process_unplugged_interface_empty(
+ self, tenant_id="test_tenant", network_name="test_network"):
+ """ test to unplug not plugged port. It should not raise exception
+ """
+ LOG.debug("test_process_unplugged_interface_empty - START")
+ new_network = (
+ self._linuxbridge_plugin.create_network(tenant_id, network_name))
+ new_port = self._linuxbridge_plugin.create_port(
+ tenant_id, new_network[lconst.NET_ID], lconst.PORT_UP)
+ self._linuxbridge_plugin.unplug_interface(tenant_id,
+ new_network[lconst.NET_ID],
+ new_port[lconst.PORT_ID])
+ self.tearDownNetworkPort(tenant_id, new_network[lconst.NET_ID],
+ new_port[lconst.PORT_ID])
+
+ LOG.debug("test_process_unplugged_interface_empty -END")
+
def test_process_unplugged_gw_interface(
self, tenant_id="test_tenant", network_name="test_network",
interface_id='fe701ddf-26a2-42ea-b9e6-7313d1c522cc',