Remove use of six
nodepool is python3 only now, so there is no need to continue to use the six library. Remove its use and shift to just using python3 versions of things. Change-Id: Ic1d1b4b736deba1b8325adf0b446e2121eaa6b20
This commit is contained in:
parent
98850e16a3
commit
6ae554162c
@ -25,8 +25,6 @@ import os
|
||||
import time
|
||||
import threading
|
||||
|
||||
import six
|
||||
|
||||
from kazoo import exceptions as kze
|
||||
|
||||
from nodepool import zk
|
||||
@ -107,8 +105,7 @@ class Drivers:
|
||||
raise RuntimeError("%s: unknown driver" % name)
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class Provider(object):
|
||||
class Provider(object, metaclass=abc.ABCMeta):
|
||||
"""The Provider interface
|
||||
|
||||
The class or instance attribute **name** must be provided as a string.
|
||||
@ -147,8 +144,7 @@ class Provider(object):
|
||||
pass
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class NodeRequestHandler(object):
|
||||
class NodeRequestHandler(object, metaclass=abc.ABCMeta):
|
||||
'''
|
||||
Class to process a single nodeset request.
|
||||
|
||||
@ -707,8 +703,7 @@ class Driver(ConfigValue):
|
||||
pass
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class ProviderConfig(ConfigValue):
|
||||
class ProviderConfig(ConfigValue, metaclass=abc.ABCMeta):
|
||||
"""The Provider config interface
|
||||
|
||||
The class or instance attribute **name** must be provided as a string.
|
||||
|
@ -18,9 +18,8 @@
|
||||
|
||||
import sys
|
||||
import threading
|
||||
import six
|
||||
from six.moves import queue as Queue
|
||||
import logging
|
||||
import queue
|
||||
import time
|
||||
import requests.exceptions
|
||||
|
||||
@ -51,7 +50,7 @@ class Task(object):
|
||||
def wait(self):
|
||||
self._wait_event.wait()
|
||||
if self._exception:
|
||||
six.reraise(self._exception, None, self._traceback)
|
||||
raise self._exception.with_traceback(self._traceback)
|
||||
return self._result
|
||||
|
||||
def run(self, client):
|
||||
@ -69,7 +68,7 @@ class TaskManager(threading.Thread):
|
||||
def __init__(self, client, name, rate):
|
||||
super(TaskManager, self).__init__(name=name)
|
||||
self.daemon = True
|
||||
self.queue = Queue.Queue()
|
||||
self.queue = queue.Queue()
|
||||
self._running = True
|
||||
self.name = name
|
||||
self.rate = float(rate)
|
||||
|
@ -16,7 +16,7 @@
|
||||
import json
|
||||
import logging
|
||||
import yaml
|
||||
from six.moves.urllib import request
|
||||
from urllib import request
|
||||
|
||||
from nodepool import tests
|
||||
from nodepool import zk
|
||||
|
@ -17,7 +17,6 @@ from copy import copy
|
||||
import abc
|
||||
import json
|
||||
import logging
|
||||
import six
|
||||
import time
|
||||
from kazoo.client import KazooClient, KazooState
|
||||
from kazoo import exceptions as kze
|
||||
@ -204,7 +203,7 @@ class BaseModel(Serializable):
|
||||
|
||||
@id.setter
|
||||
def id(self, value):
|
||||
if not isinstance(value, six.string_types):
|
||||
if not isinstance(value, str):
|
||||
raise TypeError("'id' attribute must be a string type")
|
||||
self._id = value
|
||||
|
||||
|
@ -7,8 +7,6 @@ extras
|
||||
statsd>=3.0
|
||||
sqlalchemy>=0.8.2,<1.1.0
|
||||
PrettyTable>=0.6,<0.8
|
||||
# shade has a looser requirement on six than nodepool, so install six first
|
||||
six>=1.7.0
|
||||
os-client-config>=1.2.0
|
||||
shade>=1.21.0
|
||||
diskimage-builder>=2.0.0
|
||||
|
Loading…
Reference in New Issue
Block a user