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:
Nijin Ashok 2017-11-23 00:21:20 +05:30 committed by René Moser
parent ee46cfd690
commit 9de76693b7

View file

@ -909,18 +909,23 @@ class VmsModule(BaseModule):
]
# Stateless snapshot may be already removed:
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(
service=snapshots_service.snapshot_service(snap_stateless[0].id),
service=snapshots_service.snapshot_service(snap_active.id),
condition=lambda snap: snap is None,
wait=self.param('wait'),
timeout=self.param('timeout'),
)
wait(
service=snapshots_service.snapshot_service(snap_active.id),
condition=lambda snap: snap.snapshot_status == otypes.SnapshotStatus.OK,
wait=self.param('wait'),
timeout=self.param('timeout'),
)
wait(
service=snapshots_service.snapshot_service(snap_stateless[0].id),
condition=lambda snap: snap.snapshot_status == otypes.SnapshotStatus.OK,
wait=self.param('wait'),
timeout=self.param('timeout'),
)
return True
def __attach_disks(self, entity):