Exemplo n.º 1
0
def bool_fixt(tmpdir, request):
    path = os.path.join(tmpdir.__str__(), "conf.conf")

    with open(path, "w") as fp:
        fp.write("tag = {}".format(request.param.data))

    return BoolFixt(config.Config(path), request.param.result)
Exemplo n.º 2
0
def get_conf():
    global conf

    if not conf:
        conf = config.Config(CONF_PATH,
                             defaults={
                                 'enable_appliance_mode': 'true',
                                 'primary_wifi_device': '',
                             })

    return conf
Exemplo n.º 3
0
def conf_fxt(tmpdir):
    path = os.path.join(tmpdir.__str__(), "conf.conf")

    with open(path, 'w') as fp:
        fp.write(
            textwrap.dedent("""
                #
                # comment
                #
                tag1=val1
                tag2: val2
                tag3 = val3
                # tag4 = val4
                """))

    return config.Config(path)
Exemplo n.º 4
0
def load_data():
    conf = config.Config(
        CONF_PATH,
        defaults={
            'base_name': 'comitup',
            'web_service': '',
            'external_callback': '/usr/local/bin/comitup-callback',
        },
    )

    data = persist.persist(
        PERSIST_PATH,
        {'id': str(random.randrange(1000, 9999))},
    )

    return (conf, data)
Exemplo n.º 5
0
def dual_enabled():
    conf = config.Config(CONF_PATH, defaults={'enable_appliance_mode': 'true'})
    return conf.enable_appliance_mode == 'true'