diff --git a/CHANGES/+git_sync_clone.bugfix b/CHANGES/+git_sync_clone.bugfix new file mode 100644 index 000000000..ff157c37a --- /dev/null +++ b/CHANGES/+git_sync_clone.bugfix @@ -0,0 +1 @@ +Fixed a bug that made synching git repositories fail on clone. diff --git a/pulp_ansible/app/tasks/collections.py b/pulp_ansible/app/tasks/collections.py index 5bbb4b851..a78bd6be1 100644 --- a/pulp_ansible/app/tasks/collections.py +++ b/pulp_ansible/app/tasks/collections.py @@ -90,13 +90,15 @@ async def declarative_content_from_git_repo(remote, url, git_ref=None, metadata_ if git_ref: try: gitrepo = Repo.clone_from( - url, uuid4(), depth=1, branch=git_ref, multi_options=["--recurse-submodules"] + url, str(uuid4()), depth=1, branch=git_ref, multi_options=["--recurse-submodules"] ) except GitCommandError: - gitrepo = Repo.clone_from(url, uuid4(), multi_options=["--recurse-submodules"]) + gitrepo = Repo.clone_from(url, str(uuid4()), multi_options=["--recurse-submodules"]) gitrepo.git.checkout(git_ref) else: - gitrepo = Repo.clone_from(url, uuid4(), depth=1, multi_options=["--recurse-submodules"]) + gitrepo = Repo.clone_from( + url, str(uuid4()), depth=1, multi_options=["--recurse-submodules"] + ) commit_sha = gitrepo.head.commit.hexsha metadata, artifact_path = sync_collection(gitrepo.working_dir, ".") if not metadata_only: