def create_local_mirror(local_git_dir, project_git, gerrit_system_user, gerrit_system_group): git_mirror_path = os.path.join(local_git_dir, project_git) if not os.path.exists(git_mirror_path): (ret, output) = u.run_command_status( "git --bare init %s" % git_mirror_path) if ret: u.run_command("rm -rf git_mirror_path") raise Exception(output) u.run_command( "chown -R %s:%s %s" % ( gerrit_system_user, gerrit_system_group, git_mirror_path))
def create_local_mirror(local_git_dir, project_git, gerrit_system_user, gerrit_system_group): git_mirror_path = os.path.join(local_git_dir, project_git) if not os.path.exists(git_mirror_path): (ret, output) = u.run_command_status("git --bare init %s" % git_mirror_path) if ret: u.run_command("rm -rf git_mirror_path") raise Exception(output) u.run_command( "chown -R %s:%s %s" % (gerrit_system_user, gerrit_system_group, git_mirror_path))
def copy_acl_config(project, repo_path, acl_config): if not os.path.exists(acl_config): raise CopyACLException() acl_dest = os.path.join(repo_path, "project.config") status, _ = u.run_command("cp %s %s" % (acl_config, acl_dest), status=True) if status != 0: raise CopyACLException() status = u.git_command(repo_path, "diff --quiet") return status != 0
def copy_acl_config(project, repo_path, acl_config): if not os.path.exists(acl_config): raise CopyACLException() acl_dest = os.path.join(repo_path, "project.config") status, _ = u.run_command( "cp %s %s" % (acl_config, acl_dest), status=True) if status != 0: raise CopyACLException() status = u.git_command(repo_path, "diff --quiet") return status != 0