From 6a9f0f9fbd1e86f320ccc188403cd2e1a2a66c70 Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Wed, 8 Feb 2017 14:42:08 -0800 Subject: fix super() calls, must use explicit class name self.__class__ is not correct. For Python 2 we have to explicitly use the class name see http://stackoverflow.com/questions/4235078/how-to-avoid-infinite-recursion-with-super Change-Id: I584ca565707b7331c1742fb33c8b524f7b7c9bf9 Signed-off-by: Ross Brattain --- yardstick/benchmark/contexts/dummy.py | 2 +- yardstick/benchmark/contexts/heat.py | 2 +- yardstick/benchmark/contexts/model.py | 6 +++--- yardstick/benchmark/contexts/node.py | 2 +- yardstick/benchmark/contexts/standalone.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/yardstick/benchmark/contexts/dummy.py b/yardstick/benchmark/contexts/dummy.py index f7530035c..0edc250f8 100644 --- a/yardstick/benchmark/contexts/dummy.py +++ b/yardstick/benchmark/contexts/dummy.py @@ -22,7 +22,7 @@ class DummyContext(Context): __context_type__ = "Dummy" def __init__(self): - super(self.__class__, self).__init__() + super(DummyContext, self).__init__() def init(self, attrs): pass diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py index 0346efcf4..a97a3e2c4 100644 --- a/yardstick/benchmark/contexts/heat.py +++ b/yardstick/benchmark/contexts/heat.py @@ -55,7 +55,7 @@ class HeatContext(Context): self.key_filename = ''.join( [YARDSTICK_ROOT_PATH, 'yardstick/resources/files/yardstick_key-', get_short_key_uuid(self.key_uuid)]) - super(self.__class__, self).__init__() + super(HeatContext, self).__init__() def init(self, attrs): """initializes itself from the supplied arguments""" diff --git a/yardstick/benchmark/contexts/model.py b/yardstick/benchmark/contexts/model.py index 636abfa35..c83a209cf 100644 --- a/yardstick/benchmark/contexts/model.py +++ b/yardstick/benchmark/contexts/model.py @@ -66,7 +66,7 @@ class Router(Object): """Class that represents a router in the logical model""" def __init__(self, name, network_name, context, external_gateway_info): - super(self.__class__, self).__init__(name, context) + super(Router, self).__init__(name, context) self.stack_name = context.name + "-" + network_name + "-" + self.name self.stack_if_name = self.stack_name + "-if0" @@ -78,7 +78,7 @@ class Network(Object): list = [] def __init__(self, name, context, attrs): - super(self.__class__, self).__init__(name, context) + super(Network, self).__init__(name, context) self.stack_name = context.name + "-" + self.name self.subnet_stack_name = self.stack_name + "-subnet" self.subnet_cidr = attrs.get('cidr', '10.0.1.0/24') @@ -118,7 +118,7 @@ class Server(Object): list = [] def __init__(self, name, context, attrs): - super(self.__class__, self).__init__(name, context) + super(Server, self).__init__(name, context) self.stack_name = self.name + "." + context.name self.keypair_name = context.keypair_name self.secgroup_name = context.secgroup_name diff --git a/yardstick/benchmark/contexts/node.py b/yardstick/benchmark/contexts/node.py index 9242e2727..c7ed3b3f1 100644 --- a/yardstick/benchmark/contexts/node.py +++ b/yardstick/benchmark/contexts/node.py @@ -32,7 +32,7 @@ class NodeContext(Context): self.controllers = [] self.computes = [] self.baremetals = [] - super(self.__class__, self).__init__() + super(NodeContext, self).__init__() def read_config_file(self): """Read from config file""" diff --git a/yardstick/benchmark/contexts/standalone.py b/yardstick/benchmark/contexts/standalone.py index c1d963f50..eff700974 100644 --- a/yardstick/benchmark/contexts/standalone.py +++ b/yardstick/benchmark/contexts/standalone.py @@ -37,7 +37,7 @@ class StandaloneContext(Context): self.file_path = None self.nodes = [] self.nfvi_node = [] - super(self.__class__, self).__init__() + super(StandaloneContext, self).__init__() def read_config_file(self): """Read from config file""" -- cgit 1.2.3-korg