networking_generic_switch.devices package

Subpackages

Submodules

networking_generic_switch.devices.utils module

networking_generic_switch.devices.utils.get_hostname()

Helper to allow isolation of CONF.host and plugin loading.

networking_generic_switch.devices.utils.get_switch_device(switches, switch_info=None, ngs_mac_address=None)

Return switch device by specified identifier.

Returns switch device from switches array that matched with any of passed identifiers. ngs_mac_address takes precedence over switch_info, if didn’t match any address based on mac fallback to switch_info.

Parameters:
  • switch_info – hostname of the switch or any other switch identifier.

  • ngs_mac_address – Normalized mac address of the switch.

Returns:

switch device matches by specified identifier or None.

networking_generic_switch.devices.utils.sanitise_config(config)

Return a sanitised configuration of a switch device.

Parameters:

config – a configuration dict to sanitise.

Returns:

a copy of the configuration, with sensitive fields removed.

Module contents

class networking_generic_switch.devices.GenericSwitchDevice(device_cfg, device_name='')

Bases: object

abstract add_network(segmentation_id, network_id)
add_subports_on_trunk(binding_profile, port_id, subports)

Allow subports on trunk

Parameters:
  • binding_profile – Binding profile of parent port

  • port_id – The name of the switch port from Local Link Information

  • subports – List with subports objects.

abstract del_network(segmentation_id, network_id)
del_subports_on_trunk(binding_profile, port_id, subports)

Allow subports on trunk

Parameters:
  • binding_profile – Binding profile of parent port

  • port_id – The name of the switch port from Local Link Information

  • subports – List with subports objects.

abstract delete_port(port_id, segmentation_id, trunk_details=None)

Delete port from specific network.

Parameters:
  • port_id – Then name of the switch interface

  • segmentation_id – VLAN identifier of the network used as access or native VLAN for port.

  • trunk_details – trunk information if port is a part of trunk

is_allowed(port_id, segmentation_id)
plug_bond_to_network(bond_id, segmentation_id, trunk_details=None)

Plug bond port into network.

Parameters:
  • port_id – Then name of the switch interface

  • segmentation_id – VLAN identifier of the network used as access or native VLAN for port.

  • trunk_details – trunk information if port is a part of trunk

abstract plug_port_to_network(port_id, segmentation_id, trunk_details=None)

Plug port into network.

Parameters:
  • port_id – Then name of the switch interface

  • segmentation_id – VLAN identifier of the network used as access or native VLAN for port.

  • trunk_details – trunk information if port is a part of trunk

property support_trunk_on_bond_ports
property support_trunk_on_ports
unplug_bond_from_network(bond_id, segmentation_id, trunk_details=None)

Unplug bond port from network.

Parameters:
  • port_id – Then name of the switch interface

  • segmentation_id – VLAN identifier of the network used as access or native VLAN for port.

  • trunk_details – trunk information if port is a part of trunk

networking_generic_switch.devices.device_manager(device_cfg, device_name='')