Merge pull request #66626 from dwoz/nigthlyfix

[3006.x] Fix broken gitfs ssh tests on nightly builds
This commit is contained in:
David Murphy 2024-06-11 09:35:30 -06:00 committed by GitHub
commit bff5a809cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,6 +6,7 @@ import errno
import logging import logging
import os import os
import shutil import shutil
import subprocess
import tempfile import tempfile
import textwrap import textwrap
@ -595,6 +596,12 @@ class GitPillarSSHTestBase(GitPillarTestBase):
) )
self.make_repo(root_dir, user=self.username) self.make_repo(root_dir, user=self.username)
self.make_extra_repo(root_dir, user=self.username) self.make_extra_repo(root_dir, user=self.username)
# Force git repo ownership to prevent "fatal: detected dubious
# ownership in repository" errors.
subprocess.run(
["chown", "-R", f"{self.username}:users", f"/home/{self.username}"],
check=True,
)
log.info("%s.setUp() complete.", self.__class__.__name__) log.info("%s.setUp() complete.", self.__class__.__name__)
def get_pillar(self, ext_pillar_conf): def get_pillar(self, ext_pillar_conf):