ironic_lib.utils
Module¶Utilities and helper functions.
ironic_lib.utils.
dd
(src, dst, *args)[source]¶Execute dd from src to dst.
Parameters: |
|
---|---|
Raises: | processutils.ProcessExecutionError if it failed to run the process. |
ironic_lib.utils.
execute
(*cmd, **kwargs)[source]¶Convenience wrapper around oslo’s execute() method.
Executes and logs results from a system command. See docs for oslo_concurrency.processutils.execute for usage.
Parameters: |
|
---|---|
Returns: | (stdout, stderr) from process execution |
Raises: | UnknownArgumentError on receiving unknown arguments |
Raises: | ProcessExecutionError |
Raises: | OSError |
ironic_lib.utils.
match_root_device_hints
(devices, root_device_hints)[source]¶Try to find a device that matches the root device hints.
Try to find a device that matches the root device hints. In order for a device to be matched it needs to satisfy all the given hints.
Parameters: |
|
||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Raises: | ValueError, if some information is invalid. |
||||||||||||||||||||||||||
Returns: | The first device to match all the hints or None. |
ironic_lib.utils.
mkfs
(fs, path, label=None)[source]¶Format a file or block device
Parameters: |
|
---|
ironic_lib.utils.
parse_root_device_hints
(root_device)[source]¶Parse the root_device property of a node.
Parses and validates the root_device property of a node. These are hints for how a node’s root device is created. The ‘size’ hint should be a positive integer. The ‘rotational’ hint should be a Boolean value.
Parameters: | root_device – the root_device dictionary from the node’s property. |
---|---|
Returns: | a dictionary with the root device hints parsed or None if there are no hints. |
Raises: | ValueError, if some information is invalid. |
ironic_lib.utils.
wait_for_disk_to_become_available
(device)[source]¶Wait for a disk device to become available.
Waits for a disk device to become available for use by waiting until all process locks on the device have been released.
Timeout and iteration settings come from the configuration
options used by the in-library disk_partitioner:
check_device_interval
and check_device_max_retries
.
Params device: | The path to the device. |
---|---|
Raises: | IronicException If the disk fails to become available. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.