mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
ovirt_vms: Fix issue in stopping stateless VMs (#32955)
Because of wrong condition defined, the module will wait indefinitely for snapshots to be removed and will finally timeout after the timeout interval.
This commit is contained in:
parent
ee46cfd690
commit
9de76693b7
1 changed files with 12 additions and 7 deletions
|
@ -909,18 +909,23 @@ class VmsModule(BaseModule):
|
||||||
]
|
]
|
||||||
# Stateless snapshot may be already removed:
|
# Stateless snapshot may be already removed:
|
||||||
if snap_stateless:
|
if snap_stateless:
|
||||||
|
"""
|
||||||
|
We need to wait for Active snapshot ID, to be removed as it's current
|
||||||
|
stateless snapshot. Then we need to wait for staless snapshot ID to
|
||||||
|
be read, for use, because it will become active snapshot.
|
||||||
|
"""
|
||||||
wait(
|
wait(
|
||||||
service=snapshots_service.snapshot_service(snap_stateless[0].id),
|
service=snapshots_service.snapshot_service(snap_active.id),
|
||||||
condition=lambda snap: snap is None,
|
condition=lambda snap: snap is None,
|
||||||
wait=self.param('wait'),
|
wait=self.param('wait'),
|
||||||
timeout=self.param('timeout'),
|
timeout=self.param('timeout'),
|
||||||
)
|
)
|
||||||
wait(
|
wait(
|
||||||
service=snapshots_service.snapshot_service(snap_active.id),
|
service=snapshots_service.snapshot_service(snap_stateless[0].id),
|
||||||
condition=lambda snap: snap.snapshot_status == otypes.SnapshotStatus.OK,
|
condition=lambda snap: snap.snapshot_status == otypes.SnapshotStatus.OK,
|
||||||
wait=self.param('wait'),
|
wait=self.param('wait'),
|
||||||
timeout=self.param('timeout'),
|
timeout=self.param('timeout'),
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def __attach_disks(self, entity):
|
def __attach_disks(self, entity):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue