|
| 1 | +From 092752cac3f1821b2a72a2d255a4538b78ed543d Mon Sep 17 00:00:00 2001 |
| 2 | +From: Doug Goldstein < [email protected]> |
| 3 | +Date: Mon, 17 Feb 2025 17:19:16 -0600 |
| 4 | +Subject: [PATCH] ironic: fix logging of validation errors |
| 5 | + |
| 6 | +When validation of the node fails, since switching to the SDK the |
| 7 | +address of the ValidationResult object is displayed instead of the |
| 8 | +actual message. This has been broken since patch |
| 9 | +Ibb5b168ee0944463b996e96f033bd3dfb498e304. |
| 10 | + |
| 11 | +Change-Id: I8fbdaadd125ece6a3050b2fbb772a7bd5d7e5304 |
| 12 | +Signed-off-by: Doug Goldstein < [email protected]> |
| 13 | +--- |
| 14 | + nova/virt/ironic/driver.py | 12 +++++++++--- |
| 15 | + 1 file changed, 9 insertions(+), 3 deletions(-) |
| 16 | + |
| 17 | +diff --git a/nova/virt/ironic/driver.py b/nova/virt/ironic/driver.py |
| 18 | +index 9d6bd32126..7279af09ad 100644 |
| 19 | +--- a/nova/virt/ironic/driver.py |
| 20 | ++++ b/nova/virt/ironic/driver.py |
| 21 | +@@ -1213,14 +1213,20 @@ class IronicDriver(virt_driver.ComputeDriver): |
| 22 | + ): |
| 23 | + # something is wrong. undo what we have done |
| 24 | + self._cleanup_deploy(node, instance, network_info) |
| 25 | ++ deploy_msg = ("No Error" if validate_chk['deploy'].result |
| 26 | ++ else validate_chk['deploy'].reason) |
| 27 | ++ power_msg = ("No Error" if validate_chk['power'].result |
| 28 | ++ else validate_chk['power'].reason) |
| 29 | ++ storage_msg = ("No Error" if validate_chk['storage'].result |
| 30 | ++ else validate_chk['storage'].reason) |
| 31 | + raise exception.ValidationError(_( |
| 32 | + "Ironic node: %(id)s failed to validate. " |
| 33 | + "(deploy: %(deploy)s, power: %(power)s, " |
| 34 | + "storage: %(storage)s)") |
| 35 | + % {'id': node.id, |
| 36 | +- 'deploy': validate_chk['deploy'], |
| 37 | +- 'power': validate_chk['power'], |
| 38 | +- 'storage': validate_chk['storage']}) |
| 39 | ++ 'deploy': deploy_msg, |
| 40 | ++ 'power': power_msg, |
| 41 | ++ 'storage': storage_msg}) |
| 42 | + |
| 43 | + # Config drive |
| 44 | + configdrive_value = None |
| 45 | +-- |
| 46 | +2.39.5 (Apple Git-154) |
0 commit comments