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. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.