Skip to content
Snippets Groups Projects
Commit d0575cd5 authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "Fix wipe-disks role to work on util-linux >= 2.37"

parents bb51db15 3942d294
No related branches found
No related tags found
No related merge requests found
...@@ -28,8 +28,14 @@ import json ...@@ -28,8 +28,14 @@ import json
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
def _has_mounts(device): def _has_mounts(device):
if device["mountpoint"]: try:
return True if device["mountpoint"]:
return True
# If unmounted, the JSON output contains "mountpoints": [null] so we handle
# the KeyError here.
except KeyError:
if device["mountpoints"][0]:
return True
for child in device.get("children", []): for child in device.get("children", []):
if _has_mounts(child): if _has_mounts(child):
return True return True
...@@ -69,4 +75,4 @@ def main(): ...@@ -69,4 +75,4 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
main() main()
\ No newline at end of file
---
fixes:
- |
Fixes the ``wipe-disks`` role which was failing on supported host operating
systems due to a change in the output format of ``lsblk -J`` in
``util-linux`` version ``2.37``. LP#2051859
<https://bugs.launchpad.net/kayobe/+bug/2051859>__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment