openshift.py 文件源码

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

项目:openshift2nulecule 作者: projectatomic 项目源码 文件源码
def _find_oc():
        """
        Determine the path to oc command
        Search /usr/bin:/usr/local/bin

        Returns:
            str: path to oc binary
        """

        test_paths = ['/usr/bin/oc', '/usr/local/bin/oc']

        for path in test_paths:
            test_path = utils.get_path(path)
            logger.debug("trying oc at " + test_path)
            oc = test_path
            if os.access(oc, os.X_OK):
                logger.debug("found oc at " + test_path)
                return oc
        logger.fatal("No oc found in {}. Please provide corrent path to co "
                     "binary using --oc argument".format(":".join(test_paths)))
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号