Skip to content

Commit

Permalink
treewide: Remove useless object inheritance.
Browse files Browse the repository at this point in the history
We expect Python3 to be used and in Python3 all classes inherit from
object.

Reported-at: ovn-org#173 (comment)
Signed-off-by: Dumitru Ceara <[email protected]>
  • Loading branch information
dceara authored and LorenzoBianconi committed Oct 9, 2023
1 parent 0df7d81 commit 9ecba9a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ovn-tester/ovn_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ITERATION_STAT_NAME = 'Iteration Total'


class Context(object):
class Context:
def __init__(
self,
cluster,
Expand Down
4 changes: 2 additions & 2 deletions ovn-tester/ovn_ext_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, central_node, container):
)


class ExtCmdUnit(object):
class ExtCmdUnit:
def __init__(self, conf, central_node, worker_nodes):
self.iteration = conf.get('iteration')
self.cmd = conf.get('cmd')
Expand Down Expand Up @@ -59,7 +59,7 @@ def _node_exec(self, node):
return stdout.getvalue().strip()


class ExtCmd(object):
class ExtCmd:
def __init__(self, config, central_node, worker_nodes):
self.cmd_map = defaultdict(list)
for ext_cmd in config.get('ext_cmd', list()):
Expand Down
4 changes: 2 additions & 2 deletions ovn-tester/ovn_load_balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __str__(self):
return f"Invalid Protocol: {self.args}"


class OvnLoadBalancer(object):
class OvnLoadBalancer:
def __init__(self, lb_name, nbctl, vips=None, protocols=VALID_PROTOCOLS):
'''
Create load balancers with optional vips.
Expand Down Expand Up @@ -114,7 +114,7 @@ def get_vip_map(vip, vport, backends, backend_port, version):
}


class OvnLoadBalancerGroup(object):
class OvnLoadBalancerGroup:
def __init__(self, group_name, nbctl):
self.nbctl = nbctl
self.name = group_name
Expand Down
4 changes: 2 additions & 2 deletions ovn-tester/ovn_sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def run(self, cmd="", stdout=None, raise_on_error=False):
log.info(out)


class PhysicalNode(object):
class PhysicalNode:
def __init__(self, hostname, log_cmds):
self.ssh = SSH(hostname, log_cmds)

def run(self, cmd="", stdout=None, raise_on_error=False):
self.ssh.run(cmd=cmd, stdout=stdout, raise_on_error=raise_on_error)


class Sandbox(object):
class Sandbox:
def __init__(self, phys_node, container):
self.phys_node = phys_node
self.container = container
Expand Down
4 changes: 2 additions & 2 deletions ovn-tester/ovn_workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def get_connection_string(self, cluster_cfg, port):
DEFAULT_BACKEND_PORT = 8080


class Namespace(object):
class Namespace:
def __init__(self, cluster, name, global_cfg):
self.cluster = cluster
self.nbctl = cluster.nbctl
Expand Down Expand Up @@ -747,7 +747,7 @@ def provision_vips_to_load_balancers(self, backend_lists, version):
self.load_balancer.add_vips(vips)


class Cluster(object):
class Cluster:
def __init__(self, central_node, worker_nodes, cluster_cfg, brex_cfg):
# In clustered mode use the first node for provisioning.
self.central_node = central_node
Expand Down

0 comments on commit 9ecba9a

Please sign in to comment.