def run_ubipop_tool(config_file, workers=10, dry_run=False, capture_log=False):
    if PULP_CERT_PATH is None:
        auth = (PULP_USER, PULP_PWD)
    else:
        auth = (PULP_CERT_PATH, )

    up = ubipop.UbiPopulate(
        pulp_hostname=PULP_HOSTNAME,
        pulp_auth=auth,
        dry_run=dry_run,
        ubiconfig_filename_list=[config_file],
        ubiconfig_dir_or_url=TEST_DATA_DIR,
        insecure=not PULP_SECURE,
        workers_count=workers,
    )
    if capture_log:
        logger = logging.getLogger('ubipop')
        log_capture = io.StringIO()
        handler = logging.StreamHandler(log_capture)
        handler.setLevel(logging.WARNING)
        logger.addHandler(handler)

    up.populate_ubi_repos()

    if capture_log:
        captured = log_capture.getvalue()
        log_capture.close()
        return captured
Exemplo n.º 2
0
def main(args):
    logging.basicConfig(format=DEFAULT_LOG_FMT, datefmt=DEFAULT_DATE_FMT)

    opts, auth = parse_args(args)

    ubipop.UbiPopulate(opts.pulp_hostname, auth, opts.dry_run, opts.input,
                       opts.conf_src, opts.insecure, opts.workers,
                       opts.output_repos)\
        .populate_ubi_repos()
def run_ubipop_tool(config_file, workers=10, dry_run=False):
    if PULP_CERT_PATH is None:
        auth = (PULP_USER, PULP_PWD)
    else:
        auth = (PULP_CERT_PATH, )

    up = ubipop.UbiPopulate(
        pulp_hostname=PULP_HOSTNAME,
        pulp_auth=auth,
        dry_run=dry_run,
        ubiconfig_filename_list=[config_file],
        ubiconfig_dir_or_url=TEST_DATA_DIR,
        insecure=not PULP_SECURE,
        workers_count=workers,
    )

    up.populate_ubi_repos()
Exemplo n.º 4
0
def main(args):
    logging.basicConfig(format=DEFAULT_LOG_FMT, datefmt=DEFAULT_DATE_FMT)
    logging.getLogger("pubtools.pulplib").setLevel(logging.INFO)
    opts, auth = parse_args(args)

    ubipop.UbiPopulate(
        opts.pulp_hostname,
        auth,
        opts.dry_run,
        opts.input,
        opts.conf_src,
        opts.insecure,
        opts.workers,
        opts.output_repos,
        content_sets=opts.content_sets,
        repo_ids=opts.repo_ids,
        version=opts.version,
        content_set_regex=opts.content_set_regex,
    ).populate_ubi_repos()
Exemplo n.º 5
0
def main(args):
    opts, auth = parse_args(args)

    ubipop.UbiPopulate(opts.pulp_hostname, auth, opts.dry_run, opts.input,
                       opts.conf_src, opts.insecure, opts.workers)\
        .populate_ubi_repos()