Ejemplo n.º 1
0
        with lock.acquire(timeout=0):
            proxy = config.get(PROXY_PROPERTY) if use_proxy else None
            if prehook:
                logger.info("Running pre hook")
                if run_hook(logger, prehook,
                            os.path.join(source_root, args.project), proxy,
                            hook_timeout) != 0:
                    logger.error("pre hook failed")
                    logging.shutdown()
                    sys.exit(1)

            #
            # If one of the repositories fails to sync, the whole project sync
            # is treated as failed, i.e. the program will return 1.
            #
            for repo_path in get_repos(logger, args.project, uri):
                logger.debug("Repository path = {}".format(repo_path))

                if repo_path in ignored_repos:
                    logger.info("repository {} ignored".format(repo_path))
                    continue

                repo_type = get_repo_type(logger, repo_path, uri)
                if not repo_type:
                    logger.error(
                        "cannot determine type of {}".format(repo_path))
                    continue

                logger.debug("Repository type = {}".format(repo_type))

                repo = get_repository(logger, source_root + repo_path,
Ejemplo n.º 2
0
        with lock.acquire(timeout=0):
            proxy = config.get('proxy') if use_proxy else None
            if prehook:
                logger.info("Running pre hook")
                if run_hook(logger, prehook,
                            os.path.join(source_root, args.project), proxy,
                            hook_timeout) != 0:
                    logger.error("pre hook failed")
                    logging.shutdown()
                    sys.exit(1)

            #
            # If one of the repositories fails to sync, the whole project sync
            # is treated as failed, i.e. the program will return 1.
            #
            for repo_path in get_repos(logger, args.project, messages_file):
                logger.debug("Repository path = {}".format(repo_path))

                if repo_path in ignored_repos:
                    logger.info("repository {} ignored".format(repo_path))
                    continue

                repo_type = get_repo_type(logger, repo_path, messages_file)
                if not repo_type:
                    logger.error("cannot determine type of {}".
                                 format(repo_path))
                    continue

                logger.debug("Repository type = {}".format(repo_type))

                repo = get_repository(logger,
Ejemplo n.º 3
0
    lock = filelock.FileLock(os.path.join(tempfile.gettempdir(),
                             args.project + "-mirror.lock"))
    try:
        with lock.acquire(timeout=0):
            if prehook and run_hook(logger, prehook,
                                    os.path.join(source_root,
                                                 args.project)) != 0:
                logger.error("pre hook failed")
                logging.shutdown()
                sys.exit(1)

            #
            # If one of the repositories fails to sync, the whole project sync
            # is treated as failed, i.e. the program will return 1.
            #
            for repo_path in get_repos(logger, args.project, messages_file):
                logger.debug("Repository path = {}".format(repo_path))

                if repo_path in ignored_repos:
                    logger.debug("repository {} ignored".format(repo_path))
                    continue

                repo_type = get_repo_type(logger, repo_path, messages_file)
                if not repo_type:
                    logger.error("cannot determine type of {}".
                                 format(repopath))
                    continue

                logger.debug("Repository type = {}".format(repo_type))

                repo = get_repository(logger,