From 41d7eca08a7d335e15cb430b59b5ef75e8a8103f Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 10 May 2024 09:46:27 -0600 Subject: [PATCH] Add allowance for machine identifier for recent test --- tests/pytests/functional/utils/gitfs/test_pillar.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/pytests/functional/utils/gitfs/test_pillar.py b/tests/pytests/functional/utils/gitfs/test_pillar.py index 5d6729dc5f75..982d05581843 100644 --- a/tests/pytests/functional/utils/gitfs/test_pillar.py +++ b/tests/pytests/functional/utils/gitfs/test_pillar.py @@ -5,6 +5,7 @@ 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 +from salt.utils.platform import get_machine_identifier as _get_machine_identifier pytestmark = [ pytest.mark.windows_whitelisted, @@ -339,17 +340,24 @@ def _test_lock(opts): p.fetch_remotes() assert len(p.remotes) == 1 repo = p.remotes[0] + mach_id = _get_machine_identifier().get("machine_id", "no_machine_id_available") assert repo.get_salt_working_dir() in repo._get_lock_file() assert repo.lock() == ( [ - "Set update lock for git_pillar remote 'https://github.com/saltstack/salt-test-pillar-gitfs.git'" + ( + f"Set update lock for gitfs remote " + f"'https://github.com/saltstack/salt-test-pillar-gitfs.git' on machine_id '{mach_id}'" + ) ], [], ) assert os.path.isfile(repo._get_lock_file()) assert repo.clear_lock() == ( [ - "Removed update lock for git_pillar remote 'https://github.com/saltstack/salt-test-pillar-gitfs.git'" + ( + f"Removed update lock for gitfs remote " + f"'https://github.com/saltstack/salt-test-pillar-gitfs.git' on machine_id '{mach_id}'" + ) ], [], )