File path-replace-functools.wraps-with-six.wraps-bsc-1177.patch of Package salt

From 8959cee470dc2080fab6b9559ca71b9c24c57f0d Mon Sep 17 00:00:00 2001
From: Alberto Planas <aplanas@suse.com>
Date: Tue, 20 Oct 2020 13:13:24 +0200
Subject: [PATCH] path: replace functools.wraps with six.wraps
 (bsc#1177867) (#283)

Python 2.7 functools.wraps decorator do not add the `__wrapped__`
attribute to decorated functions, that is used by Salt to access the
original function and deduce the parameters from the signature.

This patch uses six.wraps, that add this extra attribute.
---
 salt/utils/decorators/path.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/salt/utils/decorators/path.py b/salt/utils/decorators/path.py
index 3682d0fb23..6763560122 100644
--- a/salt/utils/decorators/path.py
+++ b/salt/utils/decorators/path.py
@@ -4,11 +4,10 @@ Decorators for salt.utils.path
 """
 from __future__ import absolute_import, print_function, unicode_literals
 
-import functools
-
 # Import Salt libs
 import salt.utils.path
 from salt.exceptions import CommandNotFoundError
+import salt.ext.six
 
 
 def which(exe):
@@ -17,7 +16,7 @@ def which(exe):
     """
 
     def wrapper(function):
-        @functools.wraps(function)
+        @salt.ext.six.wraps(function)
         def wrapped(*args, **kwargs):
             if salt.utils.path.which(exe) is None:
                 raise CommandNotFoundError(
@@ -36,7 +35,7 @@ def which_bin(exes):
     """
 
     def wrapper(function):
-        @functools.wraps(function)
+        @salt.ext.six.wraps(function)
         def wrapped(*args, **kwargs):
             if salt.utils.path.which_bin(exes) is None:
                 raise CommandNotFoundError(
-- 
2.29.2


openSUSE Build Service is sponsored by