basic_deployment.py 文件源码

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

项目:charm-ceph-mon 作者: openstack 项目源码 文件源码
def find_pool(sentry_unit, pool_name):
        """
        This will do a ceph osd dump and search for pool you specify
        :param sentry_unit: The unit to run this command from.
        :param pool_name: str.  The name of the Ceph pool to query
        :return: str or None.  The ceph pool or None if not found
        """
        output, dump_code = sentry_unit.run("ceph osd dump")
        if dump_code is not 0:
            amulet.raise_status(
                amulet.FAIL,
                msg="ceph osd dump failed with output: {}".format(
                    output))
        for line in output.split('\n'):
            match = re.search(r"pool\s+\d+\s+'(?P<pool_name>.*)'", line)
            if match:
                name = match.group('pool_name')
                if name == pool_name:
                    return line
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号