ironic.networking.utils module

Utilities for networking service operations.

ironic.networking.utils.parse_vlan_ranges(vlan_spec)[source]

Parse VLAN specification into a set of VLAN IDs.

Parameters:

vlan_spec – List of VLAN IDs or ranges (e.g., [‘100’, ‘102-104’])

Returns:

Set of integer VLAN IDs

Raises:

InvalidParameterValue if the specification is invalid

ironic.networking.utils.rpc_transport()[source]

Get the RPC transport type.

ironic.networking.utils.validate_vlan_allowed(vlan_id, allowed_vlans_config=None, switch_config=None)[source]

Validate that a VLAN ID is allowed.

Parameters:
  • vlan_id – The VLAN ID to validate

  • allowed_vlans_config – Global list of allowed vlans from config

  • switch_config – Optional switch-specific configuration dict that may contain an ‘allowed_vlans’ key

Returns:

True if the VLAN is allowed

Raises:

InvalidParameterValue if the VLAN is not allowed