Browse Source

Merge "Ansible driver: fix deployment with serial specified as root device hint" into stable/rocky

changes/12/674612/1
Zuul 1 month ago
parent
commit
37ef8d6f9e

+ 4
- 1
ironic/drivers/modules/ansible/playbooks/library/facts_wwn.py View File

@@ -41,7 +41,10 @@ def get_devices_wwn(devices, module):
41 41
 
42 42
         dev_dict[device] = {}
43 43
         for key, udev_key in COLLECT_INFO:
44
-            dev_dict[device][key] = udev.get('ID_%s' % udev_key)
44
+            candidate = udev.get('ID_%s' % udev_key)
45
+            if candidate:
46
+                candidate = candidate.lower()
47
+            dev_dict[device][key] = candidate
45 48
 
46 49
     return {"ansible_facts": {"devices_wwn": dev_dict}}
47 50
 

+ 4
- 2
ironic/tests/unit/drivers/modules/ansible/test_deploy.py View File

@@ -275,8 +275,10 @@ class TestAnsibleMethods(AnsibleDeployTestCaseBase):
275 275
             ansible_deploy._prepare_extra_vars(host_list, ansible_vars))
276 276
 
277 277
     def test__parse_root_device_hints(self):
278
-        hints = {"wwn": "fake wwn", "size": "12345", "rotational": True}
279
-        expected = {"wwn": "fake wwn", "size": 12345, "rotational": True}
278
+        hints = {"wwn": "fake wwn", "size": "12345", "rotational": True,
279
+                 "serial": "HELLO"}
280
+        expected = {"wwn": "fake wwn", "size": 12345, "rotational": True,
281
+                    "serial": "hello"}
280 282
         props = self.node.properties
281 283
         props['root_device'] = hints
282 284
         self.node.properties = props

+ 5
- 0
releasenotes/notes/bug-2006275-a5ca234683ca4c32.yaml View File

@@ -0,0 +1,5 @@
1
+---
2
+fixes:
3
+    |
4
+      Fixes an issue with using serial number as root device hints
5
+      with the ``ansible`` deploy interface.

Loading…
Cancel
Save