Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayobe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kayobe
Commits
d0575cd5
Commit
d0575cd5
authored
1 year ago
by
Zuul
Committed by
Gerrit Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "Fix wipe-disks role to work on util-linux >= 2.37"
parents
bb51db15
3942d294
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansible/roles/wipe-disks/library/blockdevice_info.py
+9
-3
9 additions, 3 deletions
ansible/roles/wipe-disks/library/blockdevice_info.py
releasenotes/notes/wipe-disks-0e72c9c8b7bf7e18.yaml
+7
-0
7 additions, 0 deletions
releasenotes/notes/wipe-disks-0e72c9c8b7bf7e18.yaml
with
16 additions
and
3 deletions
ansible/roles/wipe-disks/library/blockdevice_info.py
+
9
−
3
View file @
d0575cd5
...
@@ -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
This diff is collapsed.
Click to expand it.
releasenotes/notes/wipe-disks-0e72c9c8b7bf7e18.yaml
0 → 100644
+
7
−
0
View file @
d0575cd5
---
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>__
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment