Skip to content

Commit

Permalink
Merge pull request #657 from pulp/patchback/backports/3.11/9befa2383f…
Browse files Browse the repository at this point in the history
…f63099f9dcfed3d21f7ce304fceff1/pr-651

[PR #651/9befa238 backport][3.11] Remove 'missing netrc' log messages when syncing
  • Loading branch information
gerrod3 committed Apr 11, 2024
2 parents 97e07c7 + e9495ef commit 9dfae90
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pulp_python/app/tasks/sync.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import logging
import tempfile

from aiohttp import ClientResponseError, ClientError
from lxml.etree import LxmlError
from gettext import gettext as _
from os import environ, path
from os import environ

from rest_framework import serializers

Expand Down Expand Up @@ -111,9 +112,10 @@ async def run(self):
"""
If includes is specified, then only sync those,else try to sync all other packages
"""
# Prevent bandersnatch from reading actual .netrc file, set to nonexistent file
# Prevent bandersnatch from reading actual .netrc file, set to empty file
# See discussion on https://github.com/pulp/pulp_python/issues/581
environ["NETRC"] = f"{path.curdir}/.fake-netrc"
fake_netrc = tempfile.NamedTemporaryFile(dir=".", delete=False)
environ["NETRC"] = fake_netrc.name
# TODO Change Bandersnatch internal API to take proxy settings in from config parameters
if proxy_url := self.remote.proxy_url:
if self.remote.proxy_username or self.remote.proxy_password:
Expand Down

0 comments on commit 9dfae90

Please sign in to comment.