# HG changeset patch # User RhodeCode Admin # Date 2023-07-17 12:05:36 # Node ID 29f87dc0fbcf337e0f4c86297784fef7b061ce98 # Parent dcf51ded8aca79de89baa66621fe0470b93d8e44 hooks: make sure exist_ok is used for multiprocess errors diff --git a/vcsserver/hook_utils/__init__.py b/vcsserver/hook_utils/__init__.py --- a/vcsserver/hook_utils/__init__.py +++ b/vcsserver/hook_utils/__init__.py @@ -48,7 +48,7 @@ def install_git_hooks(repo_path, bare, e hooks_path = get_git_hooks_path(repo_path, bare) if not os.path.isdir(hooks_path): - os.makedirs(hooks_path, mode=0o777) + os.makedirs(hooks_path, mode=0o777, exist_ok=True) tmpl_post = pkg_resources.resource_string( 'vcsserver', '/'.join( @@ -100,7 +100,7 @@ def install_svn_hooks(repo_path, executa executable = executable or sys.executable hooks_path = get_svn_hooks_path(repo_path) if not os.path.isdir(hooks_path): - os.makedirs(hooks_path, mode=0o777) + os.makedirs(hooks_path, mode=0o777, exist_ok=True) tmpl_post = pkg_resources.resource_string( 'vcsserver', '/'.join( @@ -140,7 +140,7 @@ def install_svn_hooks(repo_path, executa def get_version_from_hook(hook_path): version = b'' hook_content = read_hook_content(hook_path) - matches = re.search(rb'(?:RC_HOOK_VER)\s*=\s*(.*)', hook_content) + matches = re.search(rb'RC_HOOK_VER\s*=\s*(.*)', hook_content) if matches: try: version = matches.groups()[0]