ironic_inspector.pxe_filter.base module

Base code for PXE boot filtering.

class ironic_inspector.pxe_filter.base.BaseFilter[source]

Bases: FilterDriver

The generic PXE boot filtering interface implementation.

This driver doesn’t do anything but provides a basic synchronization and initialization logic for some drivers to reuse. Subclasses have to provide a custom sync() method.

fsm = <automaton.machines.FiniteMachine object>
fsm_reset_on_error()[source]

Reset the filter driver upon generic exception.

The context is self.fsm. The automaton.exceptions.NotFound error is cast to the InvalidFilterDriverState error. Other exceptions trigger self.reset()

Raises:

InvalidFilterDriverState

Returns:

nothing.

get_periodic_sync_task()[source]

Get periodic sync task for the filter.

The periodic task returned is casting the InvalidFilterDriverState to the periodics.NeverAgain exception to quit looping.

Raises:

periodics.NeverAgain

Returns:

a periodic task to be run in the background.

init_filter()[source]

Base driver initialization logic. Locked.

Raises:

InvalidFilterDriverState

Returns:

nothing.

reset()[source]

Reset internal driver state.

This method is called by the fsm_context manager upon exception as well as by the tear_down_filter method. A subclass might wish to override as necessary, though must not lock the driver. The overriding subclass should up-call.

Returns:

nothing.

property state

Current driver state.

sync(ironic)[source]

Base driver sync logic. Locked.

Parameters:

ironic – obligatory ironic client instance

Returns:

nothing.

tear_down_filter()[source]

Base driver tear down logic. Locked.

Returns:

nothing.

class ironic_inspector.pxe_filter.base.Events[source]

Bases: object

PXE filter driver transitions.

initialize = 'initialize'
reset = 'reset'
sync = 'sync'
exception ironic_inspector.pxe_filter.base.InvalidFilterDriverState[source]

Bases: RuntimeError

The fsm of the filter driver raised an error.

class ironic_inspector.pxe_filter.base.NoopFilter[source]

Bases: BaseFilter

A trivial PXE boot filter.

get_periodic_sync_task()[source]

Get periodic sync task for the filter.

The periodic task returned is casting the InvalidFilterDriverState to the periodics.NeverAgain exception to quit looping.

Raises:

periodics.NeverAgain

Returns:

a periodic task to be run in the background.

class ironic_inspector.pxe_filter.base.States[source]

Bases: object

PXE filter driver states.

initialized = 'initialized'
uninitialized = 'uninitialized'
ironic_inspector.pxe_filter.base.driver()[source]

Get the driver for the PXE filter.

Returns:

the singleton PXE filter driver object.

ironic_inspector.pxe_filter.base.get_active_macs(ironic)[source]
ironic_inspector.pxe_filter.base.get_inactive_macs(ironic)[source]
ironic_inspector.pxe_filter.base.get_ironic_macs(ironic)[source]
ironic_inspector.pxe_filter.base.locked_driver_event(event)[source]

Call driver method having processed the fsm event.