prepare.py 文件源码

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

项目:aws-google-auth 作者: cevoaustralia 项目源码 文件源码
def _create_base_aws_cli_config_files_if_needed(google_config):
    def touch(fname, mode=0o600):
        flags = os.O_CREAT | os.O_APPEND
        with os.fdopen(os.open(fname, flags, mode)) as f:
            try:
                os.utime(fname, None)
            finally:
                f.close()

    aws_config_root = os.path.dirname(google_config.aws_config_location)

    if not os.path.exists(aws_config_root):
        os.mkdir(aws_config_root, 0o700)

    if not os.path.exists(google_config.aws_credentials_location):
        touch(google_config.aws_credentials_location)

    aws_credentials_root = os.path.dirname(google_config.aws_credentials_location)

    if not os.path.exists(aws_credentials_root):
        os.mkdir(aws_credentials_root, 0o700)

    if not os.path.exists(google_config.aws_config_location):
        touch(google_config.aws_config_location)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号