From f80330839d9e56a16e77b3fd4b1924942346849c Mon Sep 17 00:00:00 2001 From: Maryna Savchenko Date: Tue, 7 Nov 2023 14:38:47 +0100 Subject: [PATCH] Fix referencing to the raid_device var which is not set Change-Id: I11180e5d61d893a78583ace555f6e90ba8845950 --- ironic_python_agent/hardware.py | 2 +- .../notes/fix-raid_device-not-set-8b03688ce83ce22e.yaml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-raid_device-not-set-8b03688ce83ce22e.yaml diff --git a/ironic_python_agent/hardware.py b/ironic_python_agent/hardware.py index ffcad55cb..faa6f774c 100644 --- a/ironic_python_agent/hardware.py +++ b/ironic_python_agent/hardware.py @@ -2917,7 +2917,7 @@ class GenericHardwareManager(HardwareManager): except processutils.ProcessExecutionError as e: LOG.warning('Failed to remove superblock from' '%(device)s: %(err)s', - {'device': raid_device.name, 'err': e}) + {'device': blk.name, 'err': e}) # Erase all partition tables we created all_holder_disks_uniq = list( diff --git a/releasenotes/notes/fix-raid_device-not-set-8b03688ce83ce22e.yaml b/releasenotes/notes/fix-raid_device-not-set-8b03688ce83ce22e.yaml new file mode 100644 index 000000000..fcb7cd4c1 --- /dev/null +++ b/releasenotes/notes/fix-raid_device-not-set-8b03688ce83ce22e.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes referencing to raid_device variable before assignment, + is replaced by blk variable.