odl.py 文件源码

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

项目:functest 作者: opnfv 项目源码 文件源码
def set_robotframework_vars(cls, odlusername="admin", odlpassword="admin"):
        """Set credentials in csit/variables/Variables.robot.

        Returns:
            True if credentials are set.
            False otherwise.
        """

        try:
            for line in fileinput.input(cls.odl_variables_file,
                                        inplace=True):
                print(re.sub("@{AUTH}.*",
                             "@{{AUTH}}           {}    {}".format(
                                 odlusername, odlpassword),
                             line.rstrip()))
            return True
        except Exception:  # pylint: disable=broad-except
            cls.__logger.exception("Cannot set ODL creds:")
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号