localdisk_service.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:treadmill 作者: Morgan-Stanley 项目源码 文件源码
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
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号