ironic_python_agent.inspector module

ironic_python_agent.inspector.call_inspector(data, failures)[source]

Post data to inspector.

ironic_python_agent.inspector.collect_default(data, failures)[source]

The default inspection collector.

This is the only collector that is called by default. It collects the whole inventory as returned by the hardware manager(s).

It also tries to get BMC address, PXE boot device and the expected root device.

Parameters:
  • data – mutable data that we’ll send to inspector

  • failures – AccumulatedFailures object

ironic_python_agent.inspector.collect_extra_hardware(data, failures)[source]

Collect detailed inventory using ‘hardware-detect’ utility.

Recognizes ipa-inspection-benchmarks with list of benchmarks (possible values are cpu, disk, mem) to run. No benchmarks are run by default, as they’re pretty time-consuming.

Puts collected data as JSON under ‘data’ key. Requires ‘hardware’ python package to be installed on the ramdisk in addition to the packages in requirements.txt.

Parameters:
  • data – mutable data that we’ll send to inspector

  • failures – AccumulatedFailures object

ironic_python_agent.inspector.collect_lldp(data, failures)[source]

Collect LLDP information for network interfaces.

Parameters:
  • data – mutable data that we’ll send to inspector

  • failures – AccumulatedFailures object

ironic_python_agent.inspector.collect_logs(data, failures)[source]

Collect system logs from the ramdisk.

As inspection runs before any nodes details are known, it’s handy to have logs returned with data. This collector sends logs to inspector in format expected by the ‘ramdisk_error’ plugin: base64 encoded tar.gz.

This collector should be installed last in the collector chain, otherwise it won’t collect enough logs.

This collector does not report failures.

Parameters:
  • data – mutable data that we’ll send to inspector

  • failures – AccumulatedFailures object

ironic_python_agent.inspector.collect_pci_devices_info(data, failures)[source]

Collect a list of PCI devices.

Each PCI device entry in list is a dictionary containing vendor_id and product_id keys, which will be then used by the ironic inspector to distinguish various PCI devices.

The data is gathered from /sys/bus/pci/devices directory.

Parameters:
  • data – mutable data that we’ll send to inspector

  • failures – AccumulatedFailures object

ironic_python_agent.inspector.collect_usb_devices(data, failures)[source]

Collect USB information for connected devices.

Parameters:
  • data – mutable data that we’ll send to inspector

  • failures – AccumulatedFailures object

ironic_python_agent.inspector.extension_manager(names)[source]
ironic_python_agent.inspector.inspect()[source]

Optionally run inspection on the current node.

If inspection_callback_url is set in the configuration, get the hardware inventory from the node and post it back to the inspector.

Returns:

node UUID if inspection was successful, None if associated node was not found in inspector cache. None is also returned if inspector support is not enabled.

ironic_python_agent.inspector.wait_for_dhcp()[source]

Wait until NIC’s get their IP addresses via DHCP or timeout happens.

Depending on the value of inspection_dhcp_all_interfaces configuration option will wait for either all or only PXE booting NIC.

Note: only supports IPv4 addresses for now.

Returns:

True if all NIC’s got IP addresses, False if timeout happened. Also returns True if waiting is disabled via configuration.