From e8cd2be86e69942d677398c56479b3be857d923a Mon Sep 17 00:00:00 2001 From: cmcmarrow Date: Thu, 28 Sep 2023 01:00:13 -0500 Subject: [PATCH] auto set gitbaase defaults --- .pre-commit-config.yaml | 20 +-- salt/daemons/masterapi.py | 13 +- salt/fileserver/gitfs.py | 22 --- salt/master.py | 10 +- salt/pillar/__init__.py | 9 +- salt/pillar/git_pillar.py | 7 - salt/runners/cache.py | 10 -- salt/runners/git_pillar.py | 9 +- salt/runners/winrepo.py | 13 -- salt/utils/gitfs.py | 153 ++++++++++++++++-- tests/pytests/functional/utils/test_gitfs.py | 8 +- tests/pytests/functional/utils/test_pillar.py | 9 +- .../pytests/functional/utils/test_winrepo.py | 4 - .../fileserver/gitfs/test_gitfs_config.py | 2 - tests/unit/utils/test_gitfs.py | 2 - 15 files changed, 163 insertions(+), 128 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a97ad415a1c..76e8fbe13fcc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,7 +46,7 @@ repos: )$ - repo: https://github.com/s0undt3ch/python-tools-scripts - rev: "0.12.0" + rev: "0.18.1" hooks: - id: tools alias: check-changelog-entries @@ -1037,7 +1037,7 @@ repos: # ----- Code Formatting -------------------------------------------------------------------------------------------> - repo: https://github.com/asottile/pyupgrade - rev: v2.37.2 + rev: v3.13.0 hooks: - id: pyupgrade name: Drop six usage and Py2 support @@ -1058,7 +1058,7 @@ repos: - repo: https://github.com/s0undt3ch/salt-rewrite # Automatically rewrite code with known rules - rev: 2.4.4 + rev: 2.5.2 hooks: - id: salt-rewrite alias: rewrite-docstrings @@ -1091,7 +1091,7 @@ repos: )$ - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 23.9.1 hooks: - id: black # This tells pre-commit not to pass files to black. @@ -1104,7 +1104,7 @@ repos: )$ - repo: https://github.com/asottile/blacken-docs - rev: v1.12.1 + rev: 1.16.0 hooks: - id: blacken-docs args: [--skip-errors] @@ -1116,7 +1116,7 @@ repos: # ----- Security --------------------------------------------------------------------------------------------------> - repo: https://github.com/PyCQA/bandit - rev: "1.7.4" + rev: "1.7.5" hooks: - id: bandit alias: bandit-salt @@ -1130,7 +1130,7 @@ repos: )$ additional_dependencies: ['importlib_metadata<5'] - repo: https://github.com/PyCQA/bandit - rev: "1.7.4" + rev: "1.7.5" hooks: - id: bandit alias: bandit-tests @@ -1251,7 +1251,7 @@ repos: - looseversion - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.0.0 + rev: v1.5.1 hooks: - id: mypy alias: mypy-tools @@ -1266,7 +1266,7 @@ repos: - types-requests - repo: https://github.com/saltstack/mirrors-nox - rev: v2021.6.12 + rev: v2022.11.21 hooks: - id: nox alias: lint-salt @@ -1286,7 +1286,7 @@ repos: - pip>=20.2.4,<21.2 - repo: https://github.com/saltstack/mirrors-nox - rev: v2021.6.12 + rev: v2022.11.21 hooks: - id: nox alias: lint-tests diff --git a/salt/daemons/masterapi.py b/salt/daemons/masterapi.py index 3716c63d9939..78556329f3c2 100644 --- a/salt/daemons/masterapi.py +++ b/salt/daemons/masterapi.py @@ -41,7 +41,6 @@ import salt.utils.verify import salt.wheel from salt.defaults import DEFAULT_TARGET_DELIM -from salt.pillar import git_pillar try: import pwd @@ -65,13 +64,7 @@ def init_git_pillar(opts): for opts_dict in [x for x in opts.get("ext_pillar", [])]: if "git" in opts_dict: try: - pillar = salt.utils.gitfs.GitPillar( - opts, - opts_dict["git"], - per_remote_overrides=git_pillar.PER_REMOTE_OVERRIDES, - per_remote_only=git_pillar.PER_REMOTE_ONLY, - global_only=git_pillar.GLOBAL_ONLY, - ) + pillar = salt.utils.gitfs.GitPillar(opts, opts_dict["git"]) ret.append(pillar) except salt.exceptions.FileserverConfigError: if opts.get("git_pillar_verify_config", True): @@ -132,7 +125,7 @@ def clean_pub_auth(opts): if not os.path.exists(auth_cache): return else: - for (dirpath, dirnames, filenames) in salt.utils.path.os_walk(auth_cache): + for dirpath, dirnames, filenames in salt.utils.path.os_walk(auth_cache): for auth_file in filenames: auth_file_path = os.path.join(dirpath, auth_file) if not os.path.isfile(auth_file_path): @@ -724,7 +717,7 @@ def _file_recv(self, load): if not os.path.isdir(cdir): try: os.makedirs(cdir) - except os.error: + except OSError: pass if os.path.isfile(cpath) and load["loc"] != 0: mode = "ab" diff --git a/salt/fileserver/gitfs.py b/salt/fileserver/gitfs.py index 968e2c9ebfef..4141d96569dd 100644 --- a/salt/fileserver/gitfs.py +++ b/salt/fileserver/gitfs.py @@ -53,26 +53,6 @@ import salt.utils.gitfs from salt.exceptions import FileserverConfigError -PER_REMOTE_OVERRIDES = ( - "base", - "fallback", - "mountpoint", - "root", - "ssl_verify", - "saltenv_whitelist", - "saltenv_blacklist", - "refspecs", - "disable_saltenv_mapping", - "ref_types", - "update_interval", -) -PER_REMOTE_ONLY = ("all_saltenvs", "name", "saltenv") - -# Auth support (auth params can be global or per-remote, too) -AUTH_PROVIDERS = ("pygit2",) -AUTH_PARAMS = ("user", "password", "pubkey", "privkey", "passphrase", "insecure_auth") - - log = logging.getLogger(__name__) # Define the module's virtual name @@ -84,8 +64,6 @@ def _gitfs(init_remotes=True): return salt.utils.gitfs.GitFS( __opts__, __opts__["gitfs_remotes"], - per_remote_overrides=PER_REMOTE_OVERRIDES, - per_remote_only=PER_REMOTE_ONLY, init_remotes=init_remotes, ) diff --git a/salt/master.py b/salt/master.py index 5a317bf93b72..6b25685cb96f 100644 --- a/salt/master.py +++ b/salt/master.py @@ -321,7 +321,7 @@ def handle_key_rotate(self, now): else: log.error("Found dropfile with incorrect permissions, ignoring...") os.remove(dfn) - except os.error: + except OSError: pass if self.opts.get("publish_session"): @@ -665,9 +665,6 @@ def _pre_flight(self): git_pillar = salt.utils.gitfs.GitPillar( new_opts, repo["git"], - per_remote_overrides=salt.pillar.git_pillar.PER_REMOTE_OVERRIDES, - per_remote_only=salt.pillar.git_pillar.PER_REMOTE_ONLY, - global_only=salt.pillar.git_pillar.GLOBAL_ONLY, ) except salt.exceptions.FileserverConfigError as exc: critical_errors.append(exc.strerror) @@ -698,7 +695,6 @@ def start(self): # manager. We don't want the processes being started to inherit those # signal handlers with salt.utils.process.default_signals(signal.SIGINT, signal.SIGTERM): - # Setup the secrets here because the PubServerChannel may need # them as well. SMaster.secrets["aes"] = { @@ -884,7 +880,7 @@ def __bind(self): # Cannot delete read-only files on Windows. os.chmod(dfn, stat.S_IRUSR | stat.S_IWUSR) os.remove(dfn) - except os.error: + except OSError: pass # Wait for kill should be less then parent's ProcessManager. @@ -1572,7 +1568,7 @@ def _file_recv(self, load): if not os.path.isdir(cdir): try: os.makedirs(cdir) - except os.error: + except OSError: pass if os.path.isfile(cpath) and load["loc"] != 0: mode = "ab" diff --git a/salt/pillar/__init__.py b/salt/pillar/__init__.py index d047f367fb5b..41cb15536642 100644 --- a/salt/pillar/__init__.py +++ b/salt/pillar/__init__.py @@ -1161,16 +1161,9 @@ def ext_pillar(self, pillar, errors=None): # the git ext_pillar() func is run, but only for masterless. if self.ext and "git" in self.ext and self.opts.get("__role") != "minion": # Avoid circular import - import salt.pillar.git_pillar import salt.utils.gitfs - git_pillar = salt.utils.gitfs.GitPillar( - self.opts, - self.ext["git"], - per_remote_overrides=salt.pillar.git_pillar.PER_REMOTE_OVERRIDES, - per_remote_only=salt.pillar.git_pillar.PER_REMOTE_ONLY, - global_only=salt.pillar.git_pillar.GLOBAL_ONLY, - ) + git_pillar = salt.utils.gitfs.GitPillar(self.opts, self.ext["git"]) git_pillar.fetch_remotes() except TypeError: # Handle malformed ext_pillar diff --git a/salt/pillar/git_pillar.py b/salt/pillar/git_pillar.py index e8ece28a819f..4ae198bb03d4 100644 --- a/salt/pillar/git_pillar.py +++ b/salt/pillar/git_pillar.py @@ -398,10 +398,6 @@ from salt.exceptions import FileserverConfigError from salt.pillar import Pillar -PER_REMOTE_OVERRIDES = ("base", "env", "root", "ssl_verify", "refspecs", "fallback") -PER_REMOTE_ONLY = ("name", "mountpoint", "all_saltenvs") -GLOBAL_ONLY = ("branch",) - # Set up logging log = logging.getLogger(__name__) @@ -438,9 +434,6 @@ def ext_pillar(minion_id, pillar, *repos): # pylint: disable=unused-argument git_pillar = salt.utils.gitfs.GitPillar( opts, repos, - per_remote_overrides=PER_REMOTE_OVERRIDES, - per_remote_only=PER_REMOTE_ONLY, - global_only=GLOBAL_ONLY, ) if __opts__.get("__role") == "minion": # If masterless, fetch the remotes. We'll need to remove this once diff --git a/salt/runners/cache.py b/salt/runners/cache.py index 88a5c6be0dbe..1cc6b09de47f 100644 --- a/salt/runners/cache.py +++ b/salt/runners/cache.py @@ -10,8 +10,6 @@ import salt.config import salt.fileserver.gitfs import salt.payload -import salt.pillar.git_pillar -import salt.runners.winrepo import salt.utils.args import salt.utils.gitfs import salt.utils.master @@ -289,8 +287,6 @@ def clear_git_lock(role, remote=None, **kwargs): salt.utils.gitfs.GitFS( __opts__, __opts__["gitfs_remotes"], - per_remote_overrides=salt.fileserver.gitfs.PER_REMOTE_OVERRIDES, - per_remote_only=salt.fileserver.gitfs.PER_REMOTE_ONLY, ) ] elif role == "git_pillar": @@ -303,9 +299,6 @@ def clear_git_lock(role, remote=None, **kwargs): obj = salt.utils.gitfs.GitPillar( __opts__, ext_pillar["git"], - per_remote_overrides=salt.pillar.git_pillar.PER_REMOTE_OVERRIDES, - per_remote_only=salt.pillar.git_pillar.PER_REMOTE_ONLY, - global_only=salt.pillar.git_pillar.GLOBAL_ONLY, ) git_objects.append(obj) elif role == "winrepo": @@ -320,9 +313,6 @@ def clear_git_lock(role, remote=None, **kwargs): obj = salt.utils.gitfs.WinRepo( __opts__, remotes, - per_remote_overrides=salt.runners.winrepo.PER_REMOTE_OVERRIDES, - per_remote_only=salt.runners.winrepo.PER_REMOTE_ONLY, - global_only=salt.runners.winrepo.GLOBAL_ONLY, cache_root=base_dir, ) git_objects.append(obj) diff --git a/salt/runners/git_pillar.py b/salt/runners/git_pillar.py index 9648877b8b38..1f62e2bf2c1b 100644 --- a/salt/runners/git_pillar.py +++ b/salt/runners/git_pillar.py @@ -4,7 +4,6 @@ import logging -import salt.pillar.git_pillar import salt.utils.gitfs from salt.exceptions import SaltRunnerError @@ -67,13 +66,7 @@ def update(branch=None, repo=None): if pillar_type != "git": continue pillar_conf = ext_pillar[pillar_type] - pillar = salt.utils.gitfs.GitPillar( - __opts__, - pillar_conf, - per_remote_overrides=salt.pillar.git_pillar.PER_REMOTE_OVERRIDES, - per_remote_only=salt.pillar.git_pillar.PER_REMOTE_ONLY, - global_only=salt.pillar.git_pillar.GLOBAL_ONLY, - ) + pillar = salt.utils.gitfs.GitPillar(__opts__, pillar_conf) for remote in pillar.remotes: # Skip this remote if it doesn't match the search criteria if branch is not None: diff --git a/salt/runners/winrepo.py b/salt/runners/winrepo.py index 9e31040884cb..54b9998fdedc 100644 --- a/salt/runners/winrepo.py +++ b/salt/runners/winrepo.py @@ -20,16 +20,6 @@ log = logging.getLogger(__name__) -# Global parameters which can be overridden on a per-remote basis -PER_REMOTE_OVERRIDES = ("ssl_verify", "refspecs", "fallback") - -# Fall back to default per-remote-only. This isn't technically needed since -# salt.utils.gitfs.GitBase.__init__ will default to -# salt.utils.gitfs.PER_REMOTE_ONLY for this value, so this is mainly for -# runners and other modules that import salt.runners.winrepo. -PER_REMOTE_ONLY = salt.utils.gitfs.PER_REMOTE_ONLY -GLOBAL_ONLY = ("branch",) - def _legacy_git(): return not any( @@ -228,9 +218,6 @@ def update_git_repos(opts=None, clean=False, masterless=False): winrepo = salt.utils.gitfs.WinRepo( opts, remotes, - per_remote_overrides=PER_REMOTE_OVERRIDES, - per_remote_only=PER_REMOTE_ONLY, - global_only=GLOBAL_ONLY, cache_root=base_dir, ) winrepo.fetch_remotes() diff --git a/salt/utils/gitfs.py b/salt/utils/gitfs.py index f15b8316e758..7b79a9b1eaec 100644 --- a/salt/utils/gitfs.py +++ b/salt/utils/gitfs.py @@ -2354,9 +2354,9 @@ def __init__( self, opts, remotes=None, - per_remote_overrides=(), - per_remote_only=PER_REMOTE_ONLY, - global_only=GLOBAL_ONLY, + per_remote_overrides=None, + per_remote_only=None, + global_only=None, git_providers=None, cache_root=None, init_remotes=True, @@ -2394,12 +2394,18 @@ def fetch_remotes(self): gitfs = salt.utils.gitfs.GitFS( __opts__, __opts__['gitfs_remotes'], - per_remote_overrides=PER_REMOTE_OVERRIDES, - per_remote_only=PER_REMOTE_ONLY, git_providers=git_providers) gitfs.fetch_remotes() """ + if per_remote_overrides is None: + raise FileserverConfigError( + "Child class must provided 'per_remote_overrides'" + ) + if per_remote_only is None: + raise FileserverConfigError("Child class must provided 'per_remote_only'") + if global_only is None: + raise FileserverConfigError("Child class must provided 'global_only'") self.opts = opts self.git_providers = ( git_providers if git_providers is not None else GIT_PROVIDERS @@ -2969,6 +2975,23 @@ def do_checkout(self, repo, fetch_on_fail=True): return None +GITFS_PER_REMOTE_OVERRIDES = ( + "base", + "fallback", + "mountpoint", + "root", + "ssl_verify", + "saltenv_whitelist", + "saltenv_blacklist", + "refspecs", + "disable_saltenv_mapping", + "ref_types", + "update_interval", +) +GITFS_PER_REMOTE_ONLY = ("all_saltenvs", "name", "saltenv") +GITFS_GLOBAL_ONLY = () + + class GitFS(GitBase): """ Functionality specific to the git fileserver backend @@ -2981,8 +3004,8 @@ def __new__( cls, opts, remotes=None, - per_remote_overrides=(), - per_remote_only=PER_REMOTE_ONLY, + per_remote_overrides=None, + per_remote_only=None, git_providers=None, cache_root=None, init_remotes=True, @@ -2995,6 +3018,18 @@ def __new__( used to ensure that we garbage collect instances for threads which have exited. """ + if per_remote_overrides is not None: + salt.utils.versions.warn_until( + "Potassium", + "The `per_remote_overrides` parameter deprecated, " + "and is set to be removed in {version}. ", + ) + if per_remote_only is not None: + salt.utils.versions.warn_until( + "Potassium", + "The `per_remote_only` parameter deprecated, " + "and is set to be removed in {version}. ", + ) # No need to get the ioloop reference if we're not initializing remotes io_loop = salt.ext.tornado.ioloop.IOLoop.current() if init_remotes else None if not init_remotes or io_loop not in cls.instance_map: @@ -3005,8 +3040,9 @@ def __new__( super(GitFS, obj).__init__( opts, remotes if remotes is not None else [], - per_remote_overrides=per_remote_overrides, - per_remote_only=per_remote_only, + per_remote_overrides=GITFS_PER_REMOTE_OVERRIDES, + per_remote_only=GITFS_PER_REMOTE_ONLY, + global_only=GITFS_GLOBAL_ONLY, git_providers=git_providers if git_providers is not None else GIT_PROVIDERS, @@ -3244,7 +3280,7 @@ def _file_lists(self, load, form): if not os.path.isdir(self.file_list_cachedir): try: os.makedirs(self.file_list_cachedir) - except os.error: + except OSError: log.error("Unable to make cachedir %s", self.file_list_cachedir) return [] list_cache = salt.utils.path.join( @@ -3329,6 +3365,18 @@ def symlink_list(self, load): return {key: val for key, val in symlinks.items() if key.startswith(prefix)} +PILLAR_PER_REMOTE_OVERRIDES = ( + "base", + "env", + "root", + "ssl_verify", + "refspecs", + "fallback", +) +PILLAR_PER_REMOTE_ONLY = ("name", "mountpoint", "all_saltenvs") +PILLAR_GLOBAL_ONLY = ("branch",) + + class GitPillar(GitBase): """ Functionality specific to the git external pillar @@ -3336,6 +3384,46 @@ class GitPillar(GitBase): role = "git_pillar" + def __init__( + self, + opts, + remotes=None, + per_remote_overrides=None, + per_remote_only=None, + global_only=None, + git_providers=None, + cache_root=None, + init_remotes=True, + ): + if per_remote_overrides is not None: + salt.utils.versions.warn_until( + "Potassium", + "The `per_remote_overrides` parameter deprecated, " + "and is set to be removed in {version}. ", + ) + if per_remote_only is not None: + salt.utils.versions.warn_until( + "Potassium", + "The `per_remote_only` parameter deprecated, " + "and is set to be removed in {version}. ", + ) + if global_only is not None: + salt.utils.versions.warn_until( + "Potassium", + "The `global_only` parameter deprecated, " + "and is set to be removed in {version}. ", + ) + super().__init__( + opts, + remotes=remotes, + per_remote_overrides=PILLAR_PER_REMOTE_OVERRIDES, + per_remote_only=PILLAR_PER_REMOTE_ONLY, + global_only=PILLAR_GLOBAL_ONLY, + git_providers=git_providers, + cache_root=cache_root, + init_remotes=init_remotes, + ) + def checkout(self, fetch_on_fail=True): """ Checkout the targeted branches/tags from the git_pillar remotes @@ -3495,6 +3583,11 @@ def link_mountpoint(self, repo): return True +WINREPO_PER_REMOTE_OVERRIDES = ("ssl_verify", "refspecs", "fallback") +WINREPO_PER_REMOTE_ONLY = ("name", "mountpoint", "all_saltenvs") +WINREPO_GLOBAL_ONLY = ("branch",) + + class WinRepo(GitBase): """ Functionality specific to the winrepo runner @@ -3508,6 +3601,46 @@ class WinRepo(GitBase): # out the repos. winrepo_dirs = {} + def __init__( + self, + opts, + remotes=None, + per_remote_overrides=None, + per_remote_only=None, + global_only=None, + git_providers=None, + cache_root=None, + init_remotes=True, + ): + if per_remote_overrides is not None: + salt.utils.versions.warn_until( + "Potassium", + "The `per_remote_overrides` parameter deprecated, " + "and is set to be removed in {version}. ", + ) + if per_remote_only is not None: + salt.utils.versions.warn_until( + "Potassium", + "The `per_remote_only` parameter deprecated, " + "and is set to be removed in {version}. ", + ) + if global_only is not None: + salt.utils.versions.warn_until( + "Potassium", + "The `global_only` parameter deprecated, " + "and is set to be removed in {version}. ", + ) + super().__init__( + opts, + remotes=remotes, + per_remote_overrides=WINREPO_PER_REMOTE_OVERRIDES, + per_remote_only=WINREPO_PER_REMOTE_ONLY, + global_only=WINREPO_GLOBAL_ONLY, + git_providers=git_providers, + cache_root=cache_root, + init_remotes=init_remotes, + ) + def checkout(self, fetch_on_fail=True): """ Checkout the targeted branches/tags from the winrepo remotes diff --git a/tests/pytests/functional/utils/test_gitfs.py b/tests/pytests/functional/utils/test_gitfs.py index 30a5f147faaf..74384e1572ad 100644 --- a/tests/pytests/functional/utils/test_gitfs.py +++ b/tests/pytests/functional/utils/test_gitfs.py @@ -2,7 +2,6 @@ import pytest -from salt.fileserver.gitfs import PER_REMOTE_ONLY, PER_REMOTE_OVERRIDES from salt.utils.gitfs import GitFS, GitPython, Pygit2 from salt.utils.immutabletypes import ImmutableDict, ImmutableList @@ -61,12 +60,7 @@ def pygit2_gitfs_opts(gitfs_opts): def _get_gitfs(opts, *remotes): - return GitFS( - opts, - remotes, - per_remote_overrides=PER_REMOTE_OVERRIDES, - per_remote_only=PER_REMOTE_ONLY, - ) + return GitFS(opts, remotes) def _test_gitfs_simple(gitfs_opts): diff --git a/tests/pytests/functional/utils/test_pillar.py b/tests/pytests/functional/utils/test_pillar.py index 143edbf6ff5f..ce43ade37538 100644 --- a/tests/pytests/functional/utils/test_pillar.py +++ b/tests/pytests/functional/utils/test_pillar.py @@ -2,7 +2,6 @@ import pytest -from salt.pillar.git_pillar import GLOBAL_ONLY, PER_REMOTE_ONLY, PER_REMOTE_OVERRIDES from salt.utils.gitfs import GitPillar, GitPython, Pygit2 from salt.utils.immutabletypes import ImmutableDict, ImmutableList @@ -59,13 +58,7 @@ def pygit2_pillar_opts(pillar_opts): def _get_pillar(opts, *remotes): - return GitPillar( - opts, - remotes, - per_remote_overrides=PER_REMOTE_OVERRIDES, - per_remote_only=PER_REMOTE_ONLY, - global_only=GLOBAL_ONLY, - ) + return GitPillar(opts, remotes) @skipif_no_gitpython diff --git a/tests/pytests/functional/utils/test_winrepo.py b/tests/pytests/functional/utils/test_winrepo.py index 117d995bba6a..2ceb42e0bb03 100644 --- a/tests/pytests/functional/utils/test_winrepo.py +++ b/tests/pytests/functional/utils/test_winrepo.py @@ -2,7 +2,6 @@ import pytest -from salt.runners.winrepo import GLOBAL_ONLY, PER_REMOTE_ONLY, PER_REMOTE_OVERRIDES from salt.utils.gitfs import GitPython, Pygit2, WinRepo from salt.utils.immutabletypes import ImmutableDict, ImmutableList @@ -62,9 +61,6 @@ def _get_winrepo(opts, *remotes): return WinRepo( opts, remotes, - per_remote_overrides=PER_REMOTE_OVERRIDES, - per_remote_only=PER_REMOTE_ONLY, - global_only=GLOBAL_ONLY, ) diff --git a/tests/pytests/unit/fileserver/gitfs/test_gitfs_config.py b/tests/pytests/unit/fileserver/gitfs/test_gitfs_config.py index afd0cfdc9e27..b8b3c2419c69 100644 --- a/tests/pytests/unit/fileserver/gitfs/test_gitfs_config.py +++ b/tests/pytests/unit/fileserver/gitfs/test_gitfs_config.py @@ -113,8 +113,6 @@ def test_per_saltenv_config(): git_fs = salt.utils.gitfs.GitFS( gitfs.__opts__, gitfs.__opts__["gitfs_remotes"], - per_remote_overrides=gitfs.PER_REMOTE_OVERRIDES, - per_remote_only=gitfs.PER_REMOTE_ONLY, ) # repo1 (branch: foo) diff --git a/tests/unit/utils/test_gitfs.py b/tests/unit/utils/test_gitfs.py index 259ea056fcd4..c1a64de6a531 100644 --- a/tests/unit/utils/test_gitfs.py +++ b/tests/unit/utils/test_gitfs.py @@ -78,8 +78,6 @@ def fetch(self): self.main_class = salt.utils.gitfs.GitFS( self.opts, self.opts["gitfs_remotes"], - per_remote_overrides=salt.fileserver.gitfs.PER_REMOTE_OVERRIDES, - per_remote_only=salt.fileserver.gitfs.PER_REMOTE_ONLY, git_providers=git_providers, )