diff --git a/ironic/common/glance_service/base_image_service.py b/ironic/common/glance_service/base_image_service.py index cd37882b17..e5d1de366f 100644 --- a/ironic/common/glance_service/base_image_service.py +++ b/ironic/common/glance_service/base_image_service.py @@ -15,7 +15,6 @@ # under the License. -import functools import os import sys import time @@ -61,7 +60,7 @@ def _translate_plain_exception(exc_value): def check_image_service(func): """Creates a glance client if doesn't exists and calls the function.""" - @functools.wraps(func) + @six.wraps(func) def wrapper(self, *args, **kwargs): """Wrapper around methods calls. diff --git a/ironic/conductor/task_manager.py b/ironic/conductor/task_manager.py index 2edcabf70b..62faba6e3f 100644 --- a/ironic/conductor/task_manager.py +++ b/ironic/conductor/task_manager.py @@ -94,13 +94,12 @@ raised in the background thread.): """ -import functools - from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import timeutils import retrying +import six from ironic.common import driver_factory from ironic.common import exception @@ -121,7 +120,7 @@ def require_exclusive_lock(f): as the first parameter after "self". """ - @functools.wraps(f) + @six.wraps(f) def wrapper(*args, **kwargs): # NOTE(dtantsur): this code could be written simpler, but then unit # testing decorated functions is pretty hard, as we usually pass a Mock diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py index e767d3789b..06fe965d92 100644 --- a/ironic/drivers/base.py +++ b/ironic/drivers/base.py @@ -20,7 +20,6 @@ Abstract base classes for drivers. import abc import collections import copy -import functools import inspect import json import os @@ -624,7 +623,7 @@ def _passthru(http_methods, method=None, async=True, driver_passthru=False, passthru_logmessage = _LE('vendor_passthru failed with method %s') - @functools.wraps(func) + @six.wraps(func) def passthru_handler(*args, **kwargs): try: return func(*args, **kwargs) @@ -1043,7 +1042,7 @@ def driver_periodic_task(parallel=True, **other): semaphore = eventlet.semaphore.BoundedSemaphore() def decorator2(func): - @functools.wraps(func) + @six.wraps(func) def wrapper(*args, **kwargs): if parallel: def _internal(): diff --git a/ironic/drivers/modules/ucs/helper.py b/ironic/drivers/modules/ucs/helper.py index ffd3639458..a907e0c284 100644 --- a/ironic/drivers/modules/ucs/helper.py +++ b/ironic/drivers/modules/ucs/helper.py @@ -16,10 +16,9 @@ Ironic Cisco UCSM helper functions """ -import functools - from oslo_log import log as logging from oslo_utils import importutils +import six from ironic.common import exception from ironic.common.i18n import _ @@ -55,7 +54,7 @@ def requires_ucs_client(func): mentioned above before and after calling the actual function. """ - @functools.wraps(func) + @six.wraps(func) def wrapper(self, task, *args, **kwargs): if kwargs.get('helper') is None: kwargs['helper'] = CiscoUcsHelper(task)