本文整理汇总了Python中munch.Munch.redis_db方法的典型用法代码示例。如果您正苦于以下问题:Python Munch.redis_db方法的具体用法?Python Munch.redis_db怎么用?Python Munch.redis_db使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类munch.Munch
的用法示例。
在下文中一共展示了Munch.redis_db方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _read_unsafe
# 需要导入模块: from munch import Munch [as 别名]
# 或者: from munch.Munch import redis_db [as 别名]
def _read_unsafe(self):
cp = ConfigParser.ConfigParser()
cp.read(self.config_file)
opts = Munch()
opts.results_baseurl = _get_conf(
cp, "backend", "results_baseurl", "http://copr-be")
opts.frontend_base_url = _get_conf(
cp, "backend", "frontend_base_url", "http://copr-fe")
opts.dist_git_url = _get_conf(
cp, "backend", "dist_git_url", "http://dist-git")
opts.frontend_auth = _get_conf(
cp, "backend", "frontend_auth", "PASSWORDHERE")
opts.redis_host = _get_conf(
cp, "backend", "redis_host", "127.0.0.1")
opts.redis_port = _get_conf(
cp, "backend", "redis_port", "6379")
opts.redis_db = _get_conf(
cp, "backend", "redis_db", "0")
opts.do_sign = _get_conf(
cp, "backend", "do_sign", False, mode="bool")
opts.keygen_host = _get_conf(
cp, "backend", "keygen_host", "copr-keygen.cloud.fedoraproject.org")
opts.build_user = _get_conf(
cp, "backend", "build_user", DEF_BUILD_USER)
opts.build_groups_count = _get_conf(
cp, "backend", "build_groups", 1, mode="int")
opts.build_groups = []
for group_id in range(opts.build_groups_count):
archs = _get_conf(cp, "backend",
"group{0}_archs".format(group_id),
default="i386,x86_64").split(",")
group = {
"id": int(group_id),
"name": _get_conf(cp, "backend", "group{0}_name".format(group_id), "PC"),
"archs": archs,
"spawn_playbook": _get_conf(
cp, "backend", "group{0}_spawn_playbook".format(group_id),
default="/srv/copr-work/provision/builderpb-PC.yml"),
"terminate_playbook": _get_conf(
cp, "backend", "group{0}_terminate_playbook".format(group_id),
default="/srv/copr-work/provision/terminatepb-PC.yml"),
"max_workers": _get_conf(
cp, "backend", "group{0}_max_workers".format(group_id),
default=32, mode="int"),
"max_vm_total": _get_conf(
cp, "backend", "group{}_max_vm_total".format(group_id),
# default=16, mode="int"),
default=8, mode="int"),
"max_vm_per_user": _get_conf(
cp, "backend", "group{}_max_vm_per_user".format(group_id),
default=4, mode="int"),
"max_builds_per_vm": _get_conf(
cp, "backend", "group{}_max_builds_per_vm".format(group_id),
default=10, mode="int"),
"max_spawn_processes": _get_conf(
cp, "backend", "group{}_max_spawn_processes".format(group_id),
default=2, mode="int"),
"vm_spawn_min_interval": _get_conf(
cp, "backend", "group{}_vm_spawn_min_interval".format(group_id),
default=30, mode="int"),
"vm_dirty_terminating_timeout": _get_conf(
cp, "backend", "group{}_vm_dirty_terminating_timeout".format(group_id),
default=120, mode="int"),
"vm_health_check_period": _get_conf(
cp, "backend", "group{}_vm_health_check_period".format(group_id),
default=120, mode="int"),
"vm_health_check_max_time": _get_conf(
cp, "backend", "group{}_vm_health_check_max_time".format(group_id),
default=300, mode="int"),
"vm_max_check_fails": _get_conf(
cp, "backend", "group{}_vm_max_check_fails".format(group_id),
default=2, mode="int"),
"vm_terminating_timeout": _get_conf(
cp, "backend", "group{}_vm_terminating_timeout".format(group_id),
default=600, mode="int"),
}
opts.build_groups.append(group)
opts.vm_cycle_timeout = _get_conf(
cp, "backend", "vm_cycle_timeout",
default=10, mode="int")
opts.vm_ssh_check_timeout = _get_conf(
cp, "backend", "vm_ssh_check_timeout",
default=5, mode="int")
opts.destdir = _get_conf(cp, "backend", "destdir", None, mode="path")
#.........这里部分代码省略.........