Ansible driver: fix deployment with serial specified as root device hint
Change-Id: Ie0d56da52ae8476d9f9860c967e8e31253a63c5b Story: #2006275 Task: #35975
This commit is contained in:
parent
3958c94fa8
commit
ba207ba372
@ -41,7 +41,10 @@ def get_devices_wwn(devices, module):
|
||||
|
||||
dev_dict[device] = {}
|
||||
for key, udev_key in COLLECT_INFO:
|
||||
dev_dict[device][key] = udev.get('ID_%s' % udev_key)
|
||||
candidate = udev.get('ID_%s' % udev_key)
|
||||
if candidate:
|
||||
candidate = candidate.lower()
|
||||
dev_dict[device][key] = candidate
|
||||
|
||||
return {"ansible_facts": {"devices_wwn": dev_dict}}
|
||||
|
||||
|
@ -345,8 +345,10 @@ class TestAnsibleMethods(AnsibleDeployTestCaseBase):
|
||||
ansible_deploy._prepare_extra_vars(host_list, ansible_vars))
|
||||
|
||||
def test__parse_root_device_hints(self):
|
||||
hints = {"wwn": "fake wwn", "size": "12345", "rotational": True}
|
||||
expected = {"wwn": "fake wwn", "size": 12345, "rotational": True}
|
||||
hints = {"wwn": "fake wwn", "size": "12345", "rotational": True,
|
||||
"serial": "HELLO"}
|
||||
expected = {"wwn": "fake wwn", "size": 12345, "rotational": True,
|
||||
"serial": "hello"}
|
||||
props = self.node.properties
|
||||
props['root_device'] = hints
|
||||
self.node.properties = props
|
||||
|
5
releasenotes/notes/bug-2006275-a5ca234683ca4c32.yaml
Normal file
5
releasenotes/notes/bug-2006275-a5ca234683ca4c32.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
|
|
||||
Fixes an issue with using serial number as root device hints
|
||||
with the ``ansible`` deploy interface.
|
Loading…
Reference in New Issue
Block a user