Remove six

Change-Id: I898c97fda4e1e93c64c6b75fbfea5af80ffd684a
Story: 2008305
Task: 41274
This commit is contained in:
Adrian Czarnecki 2020-11-22 21:14:02 +01:00
parent d557944cef
commit df0fd4958f
9 changed files with 7 additions and 23 deletions

View File

@ -50,7 +50,6 @@ requests==2.14.2
requestsexceptions==1.2.0 requestsexceptions==1.2.0
rfc3986==0.3.1 rfc3986==0.3.1
simplejson==3.8.1 simplejson==3.8.1
six==1.10.0
smmap==0.9.0 smmap==0.9.0
Sphinx==2.0.0 Sphinx==2.0.0
stestr==1.0.0 stestr==1.0.0

View File

@ -10,14 +10,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from monasca_common.kafka import client_factory from monasca_common.kafka import client_factory
import six
from monasca_persister.repositories import persister from monasca_persister.repositories import persister
from monasca_persister.repositories import singleton from monasca_persister.repositories import singleton
@six.add_metaclass(singleton.Singleton) class ConfluentKafkaPersister(persister.Persister, metaclass=singleton.Singleton):
class ConfluentKafkaPersister(persister.Persister):
def __init__(self, kafka_conf, repository, client_id=""): def __init__(self, kafka_conf, repository, client_id=""):
super(ConfluentKafkaPersister, self).__init__(kafka_conf, repository) super(ConfluentKafkaPersister, self).__init__(kafka_conf, repository)

View File

@ -10,14 +10,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from monasca_common.kafka import client_factory from monasca_common.kafka import client_factory
import six
from monasca_persister.repositories import persister from monasca_persister.repositories import persister
from monasca_persister.repositories import singleton from monasca_persister.repositories import singleton
@six.add_metaclass(singleton.Singleton) class LegacyKafkaPersister(persister.Persister, metaclass=singleton.Singleton):
class LegacyKafkaPersister(persister.Persister):
def __init__(self, kafka_conf, zookeeper_conf, repository): def __init__(self, kafka_conf, zookeeper_conf, repository):
super(LegacyKafkaPersister, self).__init__(kafka_conf, repository) super(LegacyKafkaPersister, self).__init__(kafka_conf, repository)

View File

@ -13,11 +13,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import abc import abc
import six
@six.add_metaclass(abc.ABCMeta) class AbstractRepository(object, metaclass=abc.ABCMeta):
class AbstractRepository(object):
def __init__(self): def __init__(self):
super(AbstractRepository, self).__init__() super(AbstractRepository, self).__init__()

View File

@ -16,7 +16,6 @@
import abc import abc
from oslo_config import cfg from oslo_config import cfg
import six
from monasca_persister.repositories import abstract_repository from monasca_persister.repositories import abstract_repository
from monasca_persister.repositories.cassandra import connection_util from monasca_persister.repositories.cassandra import connection_util
@ -25,8 +24,7 @@ from monasca_persister.repositories import data_points
conf = cfg.CONF conf = cfg.CONF
@six.add_metaclass(abc.ABCMeta) class AbstractCassandraRepository(abstract_repository.AbstractRepository, metaclass=abc.ABCMeta):
class AbstractCassandraRepository(abstract_repository.AbstractRepository):
def __init__(self): def __init__(self):
super(AbstractCassandraRepository, self).__init__() super(AbstractCassandraRepository, self).__init__()

View File

@ -15,7 +15,6 @@
import abc import abc
import influxdb import influxdb
from oslo_config import cfg from oslo_config import cfg
import six
from monasca_persister.repositories import abstract_repository from monasca_persister.repositories import abstract_repository
from monasca_persister.repositories import data_points from monasca_persister.repositories import data_points
@ -23,8 +22,7 @@ from monasca_persister.repositories import data_points
DATABASE_NOT_FOUND_MSG = "database not found" DATABASE_NOT_FOUND_MSG = "database not found"
@six.add_metaclass(abc.ABCMeta) class AbstractInfluxdbRepository(abstract_repository.AbstractRepository, metaclass=abc.ABCMeta):
class AbstractInfluxdbRepository(abstract_repository.AbstractRepository):
def __init__(self): def __init__(self):
super(AbstractInfluxdbRepository, self).__init__() super(AbstractInfluxdbRepository, self).__init__()

View File

@ -13,20 +13,17 @@
# implied. # implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from abc import ABCMeta
import os import os
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
import six
from monasca_persister.repositories import singleton from monasca_persister.repositories import singleton
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
@six.add_metaclass(singleton.Singleton) class Persister(object, metaclass=singleton.Singleton):
class Persister(six.with_metaclass(ABCMeta, object)):
def __init__(self, kafka_conf, repository): def __init__(self, kafka_conf, repository):

View File

@ -19,7 +19,6 @@ import influxdb
from influxdb.exceptions import InfluxDBClientError from influxdb.exceptions import InfluxDBClientError
from oslotest import base from oslotest import base
from oslo_config import cfg from oslo_config import cfg
import six
from monasca_persister.repositories.influxdb.metrics_repository import MetricInfluxdbRepository from monasca_persister.repositories.influxdb.metrics_repository import MetricInfluxdbRepository
@ -37,7 +36,7 @@ class TestMetricInfluxdbRepository(base.BaseTestCase):
def _test_process_message(self, metrics_repo, data_points, metric, tenant): def _test_process_message(self, metrics_repo, data_points, metric, tenant):
_dp, _tenant = metrics_repo.process_message(metric) _dp, _tenant = metrics_repo.process_message(metric)
self.assertIsInstance(_dp, six.string_types) self.assertIsInstance(_dp, str)
self.assertEqual(_tenant, tenant) self.assertEqual(_tenant, tenant)
data_points.append(_tenant, _dp) data_points.append(_tenant, _dp)

View File

@ -4,7 +4,6 @@
oslo.config>=5.2.0 # Apache-2.0 oslo.config>=5.2.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0
six>=1.10.0 # MIT
monasca-common>=2.16.0 # Apache-2.0 monasca-common>=2.16.0 # Apache-2.0
cassandra-driver>=3.21.0 cassandra-driver>=3.21.0
simplejson>=3.8.1 simplejson>=3.8.1