Ejemplo n.º 1
0
def getDefaultOptions(host: str) -> bunch.Bunch:
    """
    get all default options for a given host
    """

    options = copy.deepcopy(OPTIONS)
    options.host = host
    for k in options:
        options[k] = getDefaultOption(options, k)
    return options
Ejemplo n.º 2
0
def getDefaultOptions(host: str, timeout_ms: int = Consts.TIMEOUT_MS) -> bunch.Bunch:
    """
    get all default options for a given host
    """

    options = copy.deepcopy(OPTIONS)
    options.host = host
    options.timeout = timeout_ms
    for k in options:
        options[k] = getDefaultOption(options, k)
    return options
Ejemplo n.º 3
0
def getDefaultOptions(host: str, timeout_ms: int = Consts.TIMEOUT_MS) -> bunch.Bunch:
    """
    get all default options for a given host
    """

    options = copy.deepcopy(OPTIONS)
    # pyre-fixme[16]: `Bunch` has no attribute `host`.
    options.host = host
    # pyre-fixme[16]: `Bunch` has no attribute `timeout`.
    options.timeout = timeout_ms
    for k in options:
        options[k] = getDefaultOption(options, k)
    return options
Ejemplo n.º 4
0
def set_option(ctx, param, value) -> None:
    name = getNameFromOpts(param.opts)
    OPTIONS[name] = value if value is not None else getDefaultOption(
        OPTIONS, name)
Ejemplo n.º 5
0
def str2cert(ctx, param, value) -> None:
    name = getNameFromOpts(param.opts)
    OPTIONS[name] = (SSL_CERT_REQS[value]
                     if value is not None else getDefaultOption(OPTIONS, name))