def synchronize(self):
"""Make sure that all stale volumes are removed.
"""
modified = False
for uniqueid in six.viewkeys(self._volumes.copy()):
if not self._volumes[uniqueid].pop('stale', False):
continue
modified = True
# This is a stale volume, destroy it.
self._destroy_volume(uniqueid)
if not modified:
return
# Now that we successfully removed a volume, retry all the pending
# resources.
for pending_id in self._pending:
self._retry_request(pending_id)
self._pending = []
# We just destroyed a volume, refresh cached status from LVM and notify
# the service of the availability of the new status.
self._vg_status = localdiskutils.refresh_vg_status(
localdiskutils.TREADMILL_VG
)
评论列表
文章目录