From f14c187a6411388a41e612910e6139ac0c51d8d0 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 17 Sep 2025 14:05:25 +0000 Subject: [PATCH] Fix erasable devices check There is a conditional which is supposed to check whether there are any erasable devices. However, in the current state, the conditional is wrong as the call is missing the node as a parameter. Signed-off-by: Jakub Jelinek Signed-off-by: Morten Stephansen Change-Id: I38768b9ba3dc1bb5160e5841865450a8d7df5466 --- ironic_python_agent/hardware.py | 5 +++-- .../notes/fix-erasable-devices-check-151da773bcb2be50.yaml | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix-erasable-devices-check-151da773bcb2be50.yaml diff --git a/ironic_python_agent/hardware.py b/ironic_python_agent/hardware.py index 44949c518..19039a0c0 100644 --- a/ironic_python_agent/hardware.py +++ b/ironic_python_agent/hardware.py @@ -2040,10 +2040,11 @@ class GenericHardwareManager(HardwareManager): """ erase_errors = {} info = node.get('driver_internal_info', {}) - if not self._list_erasable_devices: + erasable_devices = self._list_erasable_devices(node) + if not erasable_devices: LOG.debug("No erasable devices have been found.") return - for dev in self._list_erasable_devices(node): + for dev in erasable_devices: safety_check_block_device(node, dev.name) secure_erase_error = None try: diff --git a/releasenotes/notes/fix-erasable-devices-check-151da773bcb2be50.yaml b/releasenotes/notes/fix-erasable-devices-check-151da773bcb2be50.yaml new file mode 100644 index 000000000..fc6601f8d --- /dev/null +++ b/releasenotes/notes/fix-erasable-devices-check-151da773bcb2be50.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fix a conditional which is supposed to check whether there are + any erasable devices. In the previous state, the conditional + was wrong as the call was missing the node as a parameter.