From 41ab91259dc5ba93d5ad07458f829e2dd05db9f0 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 12 Aug 2016 16:29:04 -0400 Subject: [PATCH] lib: Use new style Python classes. Inherit from object in all Python classes. This is a "new style" class. It's best to always use them. In Python 3, all classes are "new style", so this ensures consistent behavior between 2 and 3. Change-Id: I958baf19a076a6cf3cc57455f05d24182ac1f005 Signed-off-by: Russell Bryant --- lib/Connmon.py | 2 +- lib/Elastic.py | 2 +- lib/Grafana.py | 2 +- lib/Metadata.py | 2 +- lib/Tools.py | 2 +- lib/WorkloadBase.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Connmon.py b/lib/Connmon.py index ed1ca0502..da9c5e95f 100644 --- a/lib/Connmon.py +++ b/lib/Connmon.py @@ -15,7 +15,7 @@ import os import logging import shutil -class Connmon: +class Connmon(object): def __init__(self, config): self.logger = logging.getLogger('browbeat.Connmon') diff --git a/lib/Elastic.py b/lib/Elastic.py index f32861201..0f38171c0 100644 --- a/lib/Elastic.py +++ b/lib/Elastic.py @@ -20,7 +20,7 @@ import sys browbeat_uuid = uuid.uuid4() -class Elastic: +class Elastic(object): """ """ diff --git a/lib/Grafana.py b/lib/Grafana.py index d2da4a63c..d545f8779 100644 --- a/lib/Grafana.py +++ b/lib/Grafana.py @@ -14,7 +14,7 @@ import logging import subprocess -class Grafana: +class Grafana(object): def __init__(self, config): self.logger = logging.getLogger('browbeat.Grafana') diff --git a/lib/Metadata.py b/lib/Metadata.py index f74dde177..ab1566483 100644 --- a/lib/Metadata.py +++ b/lib/Metadata.py @@ -15,7 +15,7 @@ import sys import os -class Metadata: +class Metadata(object): def __init__(self): pass diff --git a/lib/Tools.py b/lib/Tools.py index 69ad8caff..b398c7e53 100644 --- a/lib/Tools.py +++ b/lib/Tools.py @@ -15,7 +15,7 @@ import os import subprocess -class Tools: +class Tools(object): def __init__(self, config=None): self.logger = logging.getLogger('browbeat.Tools') diff --git a/lib/WorkloadBase.py b/lib/WorkloadBase.py index a6f468708..832e36c21 100644 --- a/lib/WorkloadBase.py +++ b/lib/WorkloadBase.py @@ -16,7 +16,7 @@ import os import yaml -class WorkloadBase: +class WorkloadBase(object): __metaclass__ = abc.ABCMeta logger = logging.getLogger('browbeat.WorkloadBase') success = 0