Merge "Use importlib instead of pkg_resources for ansible conf"

This commit is contained in:
Zuul 2024-03-25 17:11:38 +00:00 committed by Gerrit Code Review
commit 3917a4160d
1 changed files with 4 additions and 2 deletions

View File

@ -20,8 +20,8 @@ import shutil
import subprocess
import sys
import zuul.ansible
import importlib.resources
from pkg_resources import resource_string
from zuul.lib.config import get_default
@ -160,7 +160,9 @@ class AnsibleManager:
self.default_version = default_version
def load_ansible_config(self):
c = resource_string(__name__, 'ansible-config.conf').decode()
ref = importlib.resources.files('zuul').joinpath(
'lib/ansible-config.conf')
c = ref.read_bytes().decode()
config = configparser.ConfigParser()
config.read_string(c)