Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pulp_python/app/tasks/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ def sync(remote_pk, repository_pk, mirror):

def create_bandersnatch_config(remote):
"""Modifies the global Bandersnatch config state for this sync"""
config = BandersnatchConfig().config
config = BandersnatchConfig()
config["mirror"]["master"] = remote.url
config["mirror"]["workers"] = str(remote.download_concurrency)
config["mirror"]["allow_non_https"] = "true"
if not config.has_section("plugins"):
config.add_section("plugins")
config["plugins"]["enabled"] = "blocklist_release\n"
Expand Down
3 changes: 2 additions & 1 deletion pulp_python/app/viewsets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from bandersnatch.configuration import BandersnatchConfig
from django.db import transaction
from drf_spectacular.utils import extend_schema
from pathlib import Path
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.response import Response
Expand Down Expand Up @@ -496,7 +497,7 @@ def from_bandersnatch(self, request):
bander_config_file = serializer.validated_data.get("config")
name = serializer.validated_data.get("name")
policy = serializer.validated_data.get("policy")
bander_config = BandersnatchConfig(bander_config_file.file.name).config
bander_config = BandersnatchConfig(Path(bander_config_file.file.name))
data = {
"name": name,
"policy": policy,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ requires-python = ">=3.11"
dependencies = [
"pulpcore>=3.81.0,<3.100",
"pkginfo>=1.12.0,<1.13.0",
"bandersnatch>=6.3.0,<6.6", # 6.6 has breaking changes
"bandersnatch>=6.6.0,<6.7",
"pypi-simple>=1.5.0,<2.0",
]

Expand Down