From: Thanh Ha Date: Sun, 15 Mar 2015 21:11:28 +0000 (-0400) Subject: Fix pep8 violations in csit/libraries/Topology.py X-Git-Tag: release/helium-sr3~60^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=04cf681eaf240c18e9c0c8a1f3e73ae9f007d790;p=integration%2Ftest.git Fix pep8 violations in csit/libraries/Topology.py Change-Id: I5b1367067f57422f771c252d404ccd76eff3804d Signed-off-by: Thanh Ha --- diff --git a/test/csit/libraries/Topology.py b/test/csit/libraries/Topology.py index aa8708a35e..11a5c71fec 100644 --- a/test/csit/libraries/Topology.py +++ b/test/csit/libraries/Topology.py @@ -3,27 +3,31 @@ Library for the robot based system test tool of the OpenDaylight project. Authors: Baohua Yang@IBM, Denghui Huang@IBM Updated: 2013-11-10 """ -import string -import robot from robot.libraries.BuiltIn import BuiltIn + class Topology(object): ''' Topology class provide topology database and provide many method to get property of topology. ''' - topo_nodes_db=[[], - [{u'type': u'OF', u'id': u'00:00:00:00:00:00:00:01'}], - [{u'type': u'OF', u'id': u'00:00:00:00:00:00:00:01'},{u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'},{u'type': u'OF', u'id': u'00:00:00:00:00:00:00:03'}]] + topo_nodes_db = [ + [], + [{u'type': u'OF', u'id': u'00:00:00:00:00:00:00:01'}], + [{u'type': u'OF', u'id': u'00:00:00:00:00:00:00:01'}, + {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, + {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:03'}] + ] + def __init__(self): self.builtin = BuiltIn() - def get_nodes_from_topology(self,topo_level): + def get_nodes_from_topology(self, topo_level): ''' get nodes from topology database by topology tree level ''' if isinstance(topo_level, str) or isinstance(topo_level, unicode): if topo_level.isdigit(): - topo_level=int(topo_level) + topo_level = int(topo_level) if topo_level <= 0: return None return self.topo_nodes_db[topo_level]