credentials.py 文件源码

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

项目:jenkins-charm 作者: jenkinsci 项目源码 文件源码
def token(self, value=None):
        """Get or set the admin token from/to the local state."""
        if value is not None:
            # Save the token to a file
            host.write_file(
                paths.ADMIN_TOKEN, value.encode("utf-8"), owner="root",
                group="root", perms=0o0600)
        if not os.path.exists(paths.ADMIN_TOKEN):
            return None
        with open(paths.ADMIN_TOKEN, 'r') as f:
            return f.read().strip()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号