summaryrefslogtreecommitdiff
path: root/ironic/drivers/base.py
diff options
context:
space:
mode:
authorRiccardo Pittau <elfosardo@gmail.com>2019-11-29 10:16:28 +0100
committerRiccardo Pittau <elfosardo@gmail.com>2019-12-23 09:38:25 +0100
commit78c121a5d7b6efc84d541ea4de98aa910255884e (patch)
treef60d0b75107c58f14ed99f81ef9c6831ecb2feea /ironic/drivers/base.py
parent67f5a6bf5c8922a56d70daae023a004e672a88db (diff)
downloadironic-78c121a5d7b6efc84d541ea4de98aa910255884e.tar.gz
Stop using six library
Since we've dropped support for Python 2.7, it's time to look at the bright future that Python 3.x will bring and stop forcing compatibility with older versions. This patch removes the six library from requirements, not looking back. Change-Id: Ib546f16965475c32b2f8caabd560e2c7d382ac5a
Diffstat (limited to 'ironic/drivers/base.py')
-rw-r--r--ironic/drivers/base.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py
index 7508adbb8..a407cf536 100644
--- a/ironic/drivers/base.py
+++ b/ironic/drivers/base.py
@@ -20,13 +20,13 @@ Abstract base classes for drivers.
import abc
import collections
import copy
+import functools
import inspect
import json
import os
from oslo_log import log as logging
from oslo_utils import excutils
-import six
from ironic.common import exception
from ironic.common.i18n import _
@@ -189,8 +189,7 @@ ALL_INTERFACES = set(BareDriver().all_interfaces)
"""Constant holding all known interfaces."""
-@six.add_metaclass(abc.ABCMeta)
-class BaseInterface(object):
+class BaseInterface(object, metaclass=abc.ABCMeta):
"""A base interface implementing common functions for Driver Interfaces."""
supported = True
@@ -747,7 +746,7 @@ def _passthru(http_methods, method=None, async_call=True,
passthru_logmessage = 'vendor_passthru failed with method %s'
- @six.wraps(func)
+ @functools.wraps(func)
def passthru_handler(*args, **kwargs):
try:
return func(*args, **kwargs)
@@ -1138,7 +1137,7 @@ def cache_bios_settings(func):
:param func: Function or method to wrap.
"""
- @six.wraps(func)
+ @functools.wraps(func)
def wrapped(self, task, *args, **kwargs):
result = func(self, task, *args, **kwargs)
self.cache_bios_settings(task)
@@ -1545,8 +1544,7 @@ class NetworkInterface(BaseInterface):
return False
-@six.add_metaclass(abc.ABCMeta)
-class StorageInterface(BaseInterface):
+class StorageInterface(BaseInterface, metaclass=abc.ABCMeta):
"""Base class for storage interfaces."""
interface_type = 'storage'
@@ -1609,7 +1607,7 @@ def _validate_argsinfo(argsinfo):
has_description = False
for (key, value) in info.items():
if key == 'description':
- if not isinstance(value, six.string_types):
+ if not isinstance(value, str):
raise exception.InvalidParameterValue(
_('For argument "%(arg)s", "description" must be a '
'string value instead of "%(value)s".') %