Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP2
salt.18376
path-replace-functools.wraps-with-six.wraps-bsc...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File path-replace-functools.wraps-with-six.wraps-bsc-1177.patch of Package salt.18376
From f9558f82307a81d29b083c1ba3d713d0bb239354 Mon Sep 17 00:00:00 2001 From: Alberto Planas <aplanas@suse.com> Date: Tue, 20 Oct 2020 13:14:18 +0200 Subject: [PATCH] path: replace functools.wraps with six.wraps (bsc#1177867) (#281) 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 8ee7fb1d11..a763c92d22 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): @@ -16,7 +15,7 @@ def which(exe): Decorator wrapper for salt.utils.path.which ''' 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( @@ -34,7 +33,7 @@ def which_bin(exes): Decorator wrapper for salt.utils.path.which_bin ''' 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.28.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor