Fix errors in the function erase_devices_express

Prevents the UnboundLocalError in erase_devices_express clean step.

Closes-Bug: #2095499
Change-Id: I01ce5005a62638ff960d2a75f225f882b2d56973
This commit is contained in:
kubajj
2025-01-22 14:04:40 +00:00
parent 535735b746
commit 018a5f6253
2 changed files with 6 additions and 0 deletions

View File

@@ -1991,6 +1991,7 @@ class GenericHardwareManager(HardwareManager):
return
for dev in self._list_erasable_devices(node):
safety_check_block_device(node, dev.name)
secure_erase_error = None
try:
if self._is_nvme(dev):
execute_nvme_erase = info.get(

View File

@@ -0,0 +1,5 @@
---
fixes:
- |
Prevent the UnboundLocalError in erase_devices_express,
for example, on a disk failure.