ironic.drivers.modules.inspect_utils module¶
- exception ironic.drivers.modules.inspect_utils.AutoEnrollPossible(message=None, **kwargs)[source]¶
- Bases: - IronicException- Exception to indicate that the node can be enrolled. - The error message and code is the same as for NotFound to make sure we don’t disclose any information when discovery is disabled. - code = 404¶
 
- ironic.drivers.modules.inspect_utils.cache_lookup_addresses(node)[source]¶
- Cache lookup addresses for a quick access. 
- ironic.drivers.modules.inspect_utils.clean_up_swift_entries(task)[source]¶
- Delete swift entries containing inspection data. - Delete swift entries related to the node in task.node containing inspection data. The entries are - inspector_data-<task.node.uuid>-inventoryfor hardware inventory and similar for- -plugincontaining the rest of the inspection data.- Parameters:
- task – A TaskManager instance. 
 
- ironic.drivers.modules.inspect_utils.clear_lookup_addresses(node)[source]¶
- Remove lookup addresses cached on the node. 
- ironic.drivers.modules.inspect_utils.create_ports_if_not_exist(task, macs=None)[source]¶
- Create ironic ports from MAC addresses data dict. - Creates ironic ports from MAC addresses data returned with inspection or as requested by operator. Helper argument to detect the MAC address - get_mac_addressdefaults to ‘value’ part of MAC address dict key-value pair.- Parameters:
- task – A TaskManager instance. 
- macs – A sequence of MAC addresses. If - None, fetched from the task’s management interface.
 
 
- ironic.drivers.modules.inspect_utils.get_inspection_data(node, context)[source]¶
- Get inspection data. - Retrieve the inspection data for a node either from database or the Object Storage API (swift/radosgw) as configured. - Parameters:
- node – the Ironic node that the required data is about 
- context – an admin context 
 
- Returns:
- dictionary with - inventoryand- plugin_datafields
- Raises:
- NodeInventoryNotFound if no inventory has been saved 
 
- ironic.drivers.modules.inspect_utils.lookup_node(context, mac_addresses, bmc_addresses, node_uuid=None)[source]¶
- Do a node lookup by the information from the inventory. - Parameters:
- context – Request context 
- mac_addresses – List of MAC addresses. 
- bmc_addresses – List of BMC (realistically, IPMI) addresses. 
- node_uuid – Node UUID (if known). 
 
- Raises:
- NotFound with a generic message for all failures to avoid disclosing any information. 
 
- ironic.drivers.modules.inspect_utils.missing_entrypoints_callback(names)[source]¶
- Raise RuntimeError with comma-separated list of missing hooks 
- ironic.drivers.modules.inspect_utils.run_inspection_hooks(task, inventory, plugin_data, hooks, on_error_plugin_data)[source]¶
- Process data from the ramdisk using inspection hooks. 
- ironic.drivers.modules.inspect_utils.store_inspection_data(node, inventory, plugin_data, context)[source]¶
- Store inspection data. - Store the inspection data for a node. The storage is either the database or the Object Storage API (swift/radosgw) as configured. - Parameters:
- node – the Ironic node that the inspection data is about 
- inventory – the inventory to store 
- plugin_data – the plugin data (if any) to store 
- context – an admin context 
 
 
- ironic.drivers.modules.inspect_utils.validate_inspection_hooks(intf: str, enabled_hooks: List[str])[source]¶
- Validate the enabled inspection hooks. - Parameters:
- intf – Inspection interface 
- enabled_hooks – Hooks to be enabled for the inspection interface 
 
- Raises:
- RuntimeError on missing or failed to load hooks 
- Returns:
- the list of hooks that passed validation 
 
