The networking_cisco.plugins.ml2.drivers.cisco.nexus.nexus_helpers
Module¶
ML2 Nexus Driver - Helper Methods
-
networking_cisco.plugins.ml2.drivers.cisco.nexus.nexus_helpers.
format_interface_name
(intf_type, port, ch_grp=0)¶ Method to format interface name given type, port.
Given interface type, port, and channel-group, this method formats an interface name. If channel-group is non-zero, then port-channel is configured.
Parameters: - intf_type – Such as ‘ethernet’ or ‘port-channel’
- port – unique identification – 1/32 or 1
Ch_grp: If non-zero, ignore other params and format port-channel<ch_grp>
Returns: the full formatted interface name. ex: ethernet:1/32, port-channel:1
-
networking_cisco.plugins.ml2.drivers.cisco.nexus.nexus_helpers.
is_baremetal
(port)¶ Identifies ironic baremetal transactions.
There are two types of transactions.
- A host transaction which is dependent on host to interface mapping config stored in the ml2_conf.ini file. The VNIC type for this is ‘normal’ which is the assumed condition.
- A baremetal transaction which comes from the ironic project where the interfaces are provided in the port transaction. In this case the VNIC_TYPE is ‘baremetal’.
-
networking_cisco.plugins.ml2.drivers.cisco.nexus.nexus_helpers.
split_interface_name
(interface, ch_grp=0)¶ Method to split interface type, id from name.
Takes an interface name or just interface suffix and returns interface type and number separately.
Parameters: - interface – interface name or just suffix
- ch_grp – if non-zero, ignore interface name and return ‘port-channel’ grp
Returns: interface type like ‘ethernet’
Returns: returns suffix to interface name