utils.py 文件源码

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

项目:FoxHA 作者: globocom 项目源码 文件源码
def parse_config_file(
            cipher_suite, config_file="./config/foxha_config.ini"
    ):
        try:
            repo_host, repo_port, repo_database, repo_user,\
                encrypted_repo_pass =\
                Utils.get_config_values_from_config_file(config_file)
        except (ConfigParser.NoSectionError) as err:
            print_error("Config file error: {}".format(err))
            exit(99)
        except (ConfigParser.NoOptionError) as err:
            print_error("Config file error: {}".format(err))
            exit(99)

        try:
            decrypted_repo_pass = cipher_suite.decrypt(encrypted_repo_pass)
            return repo_host, repo_port, repo_database,\
                repo_user, decrypted_repo_pass
        except InvalidToken as e:
            print_error("ERROR: InvalidToken")
            exit(99)
        except Exception as e:
            print_error("ERROR: %s" % e)
            exit(3)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号