ironic.networking.switch_drivers.driver_adapter module

Driver Configuration Adapter

This module provides functionality to translate user-friendly switch configuration into driver-specific configuration formats. It allows users to configure switches using a generic format while supporting multiple switch driver implementations.

class ironic.networking.switch_drivers.driver_adapter.NetworkingDriverAdapter[source]

Bases: object

Adapter for translating switch config to driver-specific format.

preprocess_config(output_file)[source]

Transform user config into driver-specific config files.

Scans oslo.config for switch configurations and generates driver-specific config files that then get written to a driver-specific config file.

Returns:

Number of translations generated

register_translator(driver_type, translator_instance)[source]

Register a custom translator for a driver type.

Parameters:
  • driver_type – String identifier for the driver type

  • translator_instance – Instance of a translator class

reload_configuration(output_file)[source]

Reload and regenerate switch configuration files.

This method re-extracts switch configurations from the config files and regenerates the driver-specific configuration files. It should be called when the switch configuration file has been modified.

Parameters:

output_file – Path to the output file for driver-specific configs

Returns:

Number of translations generated

Raises:

NetworkError if configuration reload fails