ironic.drivers.modules.noop module

Dummy interface implementations for use as defaults with optional interfaces.

Note that unlike fake implementations, these do not pass validation and raise exceptions for user-accessible actions.

class ironic.drivers.modules.noop.FailMixin[source]

Bases: object

Mixin to add to an interface to make it fail validation.

get_properties()[source]
validate(task, *args, **kwargs)
class ironic.drivers.modules.noop.NoBIOS(*args, **kwargs)[source]

Bases: FailMixin, BIOSInterface

BIOS interface implementation that raises errors on all requests.

apply_configuration(task, settings)[source]

Validate & apply BIOS settings on the given node.

This method takes the BIOS settings from the settings param and applies BIOS settings on the given node. It may also validate the given bios settings before applying any settings and manage failures when setting an invalid BIOS config. In the case of needing password to update the BIOS config, it will be taken from the driver_info properties. After the BIOS configuration is done, cache_bios_settings will be called to update the node’s BIOS setting table with the BIOS configuration applied on the node.

Parameters:
  • task – a TaskManager instance.

  • settings – Dictionary containing the BIOS configuration.

Raises:

UnsupportedDriverExtension, if the node’s driver doesn’t support BIOS configuration.

Raises:

InvalidParameterValue, if validation of settings fails.

Raises:

MissingParameterValue, if some required parameters are missing.

Returns:

states.CLEANWAIT if BIOS configuration is in progress asynchronously or None if it is complete.

cache_bios_settings(task)[source]

Store or update BIOS properties on the given node.

This method stores BIOS properties to the bios_settings table during ‘cleaning’ operation and updates bios_settings table when apply_configuration() and factory_reset() are called to set new BIOS configurations. It will also update the timestamp of each bios setting.

Parameters:

task – a TaskManager instance.

Raises:

UnsupportedDriverExtension, if the node’s driver doesn’t support getting BIOS properties from bare metal.

Returns:

None.

factory_reset(task)[source]

Reset BIOS configuration to factory default on the given node.

This method resets BIOS configuration to factory default on the given node. After the BIOS reset action is done, cache_bios_settings will be called to update the node’s BIOS settings table with default bios settings.

Parameters:

task – a TaskManager instance.

Raises:

UnsupportedDriverExtension, if the node’s driver doesn’t support BIOS reset.

Returns:

states.CLEANWAIT if BIOS configuration is in progress asynchronously or None if it is complete.

class ironic.drivers.modules.noop.NoConsole(*args, **kwargs)[source]

Bases: FailMixin, ConsoleInterface

Console interface implementation that raises errors on all requests.

get_console(task, *args, **kwargs)

Get connection information about the console.

This method should return the necessary information for the client to access the console.

Parameters:

task – A TaskManager instance containing the node to act on.

Returns:

the console connection information.

start_console(task, *args, **kwargs)

Start a remote console for the task’s node.

This method should not raise an exception if console already started.

Parameters:

task – A TaskManager instance containing the node to act on.

stop_console(task, *args, **kwargs)

Stop the remote console session for the task’s node.

Parameters:

task – A TaskManager instance containing the node to act on.

class ironic.drivers.modules.noop.NoFirmware(*args, **kwargs)[source]

Bases: FailMixin, FirmwareInterface

Firmware interface implementation that raises errors on all requests

cache_firmware_components(task)[source]

Store or update Firmware Components on the given node.

This method stores Firmware Components to the firmware_information table during ‘cleaning’ operation. It will also update the timestamp of each Firmware Component.

Parameters:

task – a TaskManager instance.

Raises:

UnsupportedDriverExtension, if the node’s driver doesn’t support getting Firmware Components from bare metal.

update(task, settings)[source]

Update the Firmware on the given using the settings for components.

Parameters:
  • task – a TaskManager instance.

  • settings – a list of dictionaries, each dictionary contains the component name and the url that will be used to update the firmware.

Raises:

UnsupportedDriverExtension, if the node’s driver doesn’t support update via the interface.

Raises:

InvalidParameterValue, if validation of the settings fails.

Raises:

MissingParamterValue, if some required parameters are missing.

Returns:

states.CLEANWAIT if Firmware update with the settings is in progress asynchronously of None if it is complete.

class ironic.drivers.modules.noop.NoInspect(*args, **kwargs)[source]

Bases: FailMixin, InspectInterface

Inspect interface implementation that raises errors on all requests.

inspect_hardware(task, *args, **kwargs)

Inspect hardware.

Inspect hardware to obtain the essential & additional hardware properties.

Parameters:

task – A task from TaskManager.

Raises:

HardwareInspectionFailure, if unable to get essential hardware properties.

Returns:

Resulting state of the inspection i.e. states.MANAGEABLE or None.

class ironic.drivers.modules.noop.NoRAID(*args, **kwargs)[source]

Bases: FailMixin, RAIDInterface

RAID interface implementation that raises errors on all requests.

create_configuration(task, *args, **kwargs)

Creates RAID configuration on the given node.

This method creates a RAID configuration on the given node. It assumes that the target RAID configuration is already available in node.target_raid_config. Implementations of this interface are supposed to read the RAID configuration from node.target_raid_config. After the RAID configuration is done (either in this method OR in a call-back method), ironic.common.raid.update_raid_info() may be called to sync the node’s RAID-related information with the RAID configuration applied on the node.

Parameters:
  • task – A TaskManager instance.

  • create_root_volume – Setting this to False indicates not to create root volume that is specified in the node’s target_raid_config. Default value is True.

  • create_nonroot_volumes – Setting this to False indicates not to create non-root volumes (all except the root volume) in the node’s target_raid_config. Default value is True.

  • delete_existing – Setting this to True indicates to delete RAID configuration prior to creating the new configuration.

Returns:

states.CLEANWAIT (cleaning) or states.DEPLOYWAIT (deployment) if RAID configuration is in progress asynchronously, or None if it is complete.

delete_configuration(task, *args, **kwargs)

Deletes RAID configuration on the given node.

This method deletes the RAID configuration on the give node. After RAID configuration is deleted, node.raid_config should be cleared by the implementation.

Parameters:

task – A TaskManager instance.

Returns:

states.CLEANWAIT (cleaning) or states.DEPLOYWAIT (deployment) if deletion is in progress asynchronously, or None if it is complete.

validate_raid_config(task, raid_config)[source]

Validates the given RAID configuration.

This method validates the given RAID configuration. Driver implementations of this interface can override this method to support custom parameters for RAID configuration.

Parameters:
  • task – A TaskManager instance.

  • raid_config – The RAID configuration to validate.

Raises:

InvalidParameterValue, if the RAID configuration is invalid.

class ironic.drivers.modules.noop.NoRescue(*args, **kwargs)[source]

Bases: FailMixin, RescueInterface

Rescue interface implementation that raises errors on all requests.

rescue(task, *args, **kwargs)

Boot the task’s node into a rescue environment.

Parameters:

task – A TaskManager instance containing the node to act on.

Raises:

InstanceRescueFailure if node validation or rescue operation fails.

Returns:

states.RESCUEWAIT if rescue is in progress asynchronously or states.RESCUE if it is complete.

unrescue(task, *args, **kwargs)

Tear down the rescue environment, and return to normal.

Parameters:

task – A TaskManager instance containing the node to act on.

Raises:

InstanceUnrescueFailure if node validation or unrescue operation fails.

Returns:

states.ACTIVE if it is successful.

class ironic.drivers.modules.noop.NoVendor(*args, **kwargs)[source]

Bases: FailMixin, VendorInterface

Vendor interface implementation that raises errors on all requests.

driver_validate(method, **kwargs)[source]

Validate driver-vendor-passthru actions.

If invalid, raises an exception; otherwise returns None.

Parameters:
  • method – method to be validated

  • kwargs – info for action.

Raises:

MissingParameterValue if kwargs does not contain certain parameter.

Raises:

InvalidParameterValue if parameter does not match.