Merge "Fix wipe-disks role to work on util-linux >= 2.37"
This commit is contained in:
commit
d0575cd59f
@ -28,8 +28,14 @@ import json
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
def _has_mounts(device):
|
||||
if device["mountpoint"]:
|
||||
return True
|
||||
try:
|
||||
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", []):
|
||||
if _has_mounts(child):
|
||||
return True
|
||||
@ -69,4 +75,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
7
releasenotes/notes/wipe-disks-0e72c9c8b7bf7e18.yaml
Normal file
7
releasenotes/notes/wipe-disks-0e72c9c8b7bf7e18.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
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>__
|
Loading…
x
Reference in New Issue
Block a user