Fix PEP8 issues 02/53502/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 17 Mar 2017 20:36:54 +0000 (16:36 -0400)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 17 Mar 2017 22:46:29 +0000 (22:46 +0000)
Change-Id: I11a83413b03e231af0efff1352e17cbf5d3126e9
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
14 files changed:
csit/libraries/Appenders/ElasticsearchAppender.py
csit/libraries/ipaddr.py
csit/libraries/norm_json.py
csit/suites/vpnservice/custom.py
csit/variables/ovsdb/ovsdb.py
docs/conf.py
tools/distchanges/distcompare.py
tools/distchanges/gerritquery.py
tools/exabgp_files/exarpc.py
tools/fastbgp/play.py
tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_config_blaster.py
tools/odl-mdsal-clustering-tests/clustering-performance-test/shard_perf_test.py
tools/odl-mdsal-clustering-tests/scripts/cluster_rest_script.py
tools/odl-ovsdb-performance-tests/ovsdbconfigblaster.py

index 6172da8a3d68e1b07f67d7c73dc2eaaddd544412..c7c67d05182e4dd1458222384ca07cbc1d197e4d 100644 (file)
@@ -39,8 +39,8 @@ mpl.use('Agg')
 
 
 class MBeanNotFoundError(Exception):
-        def __init__(self, message, errors):
-            super(MBeanNotFoundError, self).__init__(message)
+    def __init__(self, message, errors):
+        super(MBeanNotFoundError, self).__init__(message)
 
 
 class BaseAppender(object):
@@ -173,8 +173,8 @@ class ElasticsearchAppender(BaseAppender):
 
     def _get_index(self, connection, need_all=False):
         indices = sorted([i for i in
-                         connection.indices.get_mapping().keys()
-                         if i.startswith('karaf')])
+                          connection.indices.get_mapping().keys()
+                          if i.startswith('karaf')])
         if need_all:
             return indices
         else:
index dacd381531049fe1b742d6214fc20a95de211ede..7208218683e16875018dc23094e99037f9085f85 100644 (file)
@@ -1229,7 +1229,6 @@ class IPv4Address(_BaseV4, _BaseIP):
     """Represent and manipulate single IPv4 Addresses."""
 
     def __init__(self, address):
-
         """
         Args:
             address: A string or integer representing the IP
index 8a84fc27d3df5ca99d12a635c700c6f64f12f988..8702b55121c6bcc2b6a6191f78acfe47d10a7378 100644 (file)
@@ -84,6 +84,7 @@ class _Decoder(_json.JSONDecoder):
 
     Based on: http://stackoverflow.com/questions/10885238/
     python-change-list-type-for-json-decoding"""
+
     def __init__(self, **kwargs):
         """Initialize decoder with special array implementation."""
         _json.JSONDecoder.__init__(self, **kwargs)
index 6363a6845b7e1b7e0ea18fc3ed60c0b07c6c4bfd..6ec2bf74eff3aaa2714edc0a9d4eec8e23020103 100755 (executable)
@@ -17,6 +17,7 @@ from mininet.topo import Topo
 
 class Switch1(Topo):
     """Single switch s1 connected to n=2 hosts."""
+
     def __init__(self):
         Topo.__init__(self)
         switch = self.addSwitch('s1')
@@ -28,6 +29,7 @@ class Switch1(Topo):
 
 class Switch2(Topo):
     """Single switch s2 connected to n=2 hosts."""
+
     def __init__(self):
         Topo.__init__(self)
         switch = self.addSwitch('s2')
index 4c4a2c99f62e9740e00074aa523fae8f05a0c28f..f0f9b4c4616a9b5e2cd8467df72fcddafd013470 100644 (file)
@@ -35,6 +35,7 @@ class HostTopo(Topo):
         :param host_suffix: specified else default is 1. For example: if equals to 3 (s3,h3)
         :param hosts_per_switch: Number of hosts be connected to the switch. Default is 1.
     """
+
     def __init__(self, host_suffix=1, hosts_per_switch=1, **opts):
         Topo.__init__(self, **opts)
         switch = self.addSwitch('s%s' % host_suffix)
index 55b3734a241749e8b8afede3e4f254ed3553dc71..920a57fb3f2a77b22b756936d27f4b0ddefa006e 100644 (file)
@@ -208,17 +208,17 @@ htmlhelp_basename = 'IntegrationTestdoc'
 # -- Options for LaTeX output ---------------------------------------------
 
 latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
+    # The paper size ('letterpaper' or 'a4paper').
+    #'papersize': 'letterpaper',
 
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
+    # The font size ('10pt', '11pt' or '12pt').
+    #'pointsize': '10pt',
 
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
+    # Additional stuff for the LaTeX preamble.
+    #'preamble': '',
 
-# Latex figure (float) alignment
-#'figure_align': 'htbp',
+    # Latex figure (float) alignment
+    #'figure_align': 'htbp',
 }
 
 # Grouping the document tree into LaTeX files. List of tuples
index 87b4b19ca24b2114c862d8729b396fa7166f27e6..c66d3a7d1c001150ac8d9db856ab82479bfaf11c 100644 (file)
@@ -16,7 +16,6 @@ class DistCompare(object):
         # TODO: when autorelease starts publishing the dependencies.log artifact, this function (or the consumer
         # of this tool) can take the latest dependencies.log from jenkins lastSuccessfulArtifacts and put it
         # in /tmp/ For now the functionality to read the projects from that file are commented.
-
         """
         projects = []
         with open("/tmp/dependencies.log") as dep_file:
index 1165067813a457c8b48bdcc4b81d12c00e6f7398..e46756f78121f9c41826862c72808e9d13ba0370 100644 (file)
@@ -34,6 +34,7 @@ class GitReviewException(Exception):
 
 class CommandFailed(GitReviewException):
     """Command Failure Analysis"""
+
     def __init__(self, *args):
         Exception.__init__(self, *args)
         (self.rc, self.output, self.argv, self.envp) = args
index b6283f4405d8134dd7966dc6fe3d22a70a98d908..1e9775236828a136da594865270994a88be9565f 100644 (file)
@@ -24,6 +24,7 @@ class ExaStorage(dict):
       "counters": { <msg type>: count, ...}
       "messages": { <msg type>: [hex_string1, ]}
     """
+
     def __init__(self):
         """Thread safe dictionary init"""
         super(ExaStorage, self).__init__()
index e6e8fd98b45f107ceac8868c28a3f52cb9477e75..d70cb1cf22c9e6ef41e99b7d54f19d3fa5d53b84 100755 (executable)
@@ -376,7 +376,7 @@ class MessageGenerator(object):
                     self.prefix_count_to_add_default + 1)
         s2_slots = ((self.remaining_prefixes_threshold - 1) /
                     (self.prefix_count_to_add_default -
-                    self.prefix_count_to_del_default) + 1)
+                     self.prefix_count_to_del_default) + 1)
         # S1_First_Index = 0
         # S1_Last_Index = s1_slots * self.prefix_count_to_add_default - 1
         s2_first_index = s1_slots * self.prefix_count_to_add_default
@@ -1854,6 +1854,7 @@ def job(arguments, inqueue, storage):
 
 class Rpcs:
     '''Handler for SimpleXMLRPCServer'''
+
     def __init__(self, sendqueue, storage):
         '''Init method
 
index d290ad30709e15b655530533ddf3eea0213e4e65..6fba1216998b1bf139397a185bd6267d7bcb7efe 100755 (executable)
@@ -106,6 +106,7 @@ class FlowConfigBlaster(object):
         FlowConfigBlaster Statistics: a class that stores and further processes
         statistics collected by Blaster worker threads during their execution.
         """
+
         def __init__(self):
             self.ok_rqst_rate = Counter(0.0)
             self.total_rqst_rate = Counter(0.0)
index b8ecea65e4f0991d328b4b1556019977a066f40b..e6fcf50879e451fe40d973f2bd125c854f482d0f 100755 (executable)
@@ -233,6 +233,7 @@ class TopoUrlGenerator(TestUrlGenerator):
     Class to generate test URLs from the topology shard.
     :return: List of generated Resources
     """
+
     def __init__(self, host, port, auth):
         TestUrlGenerator.__init__(self, host, port, auth)
         self.resource_string = 'restconf/operational/network-topology:network-topology/topology/flow:1'
index 3fea8b9f55758a41845b690150ae63a656249968..c1f8d32068fc34809351c7dccb9f842925f13233 100644 (file)
@@ -734,10 +734,10 @@ if __name__ == "__main__":
 
     if (args.action not in _handler_matrix or
             args.itemtype not in _handler_matrix[args.action]):
-            msg = "Unsupported combination of action: " + str(args.action)
-            msg += " and item: " + str(args.itemtype)
-            logger.error(msg)
-            raise NotImplementedError(msg)
+        msg = "Unsupported combination of action: " + str(args.action)
+        msg += " and item: " + str(args.itemtype)
+        logger.error(msg)
+        raise NotImplementedError(msg)
 
     # TODO: need to filter out situations when we cannot use more items
     # in one rest request (rpc or delete?)
index bcadef3b8220fb562f04d930695d429b8e66a1e1..b3731bc7319e645390dcebf9a22eeac2f33280f5 100644 (file)
@@ -92,7 +92,6 @@ class OvsdbConfigBlaster (object):
         return ovsdb_url
 
     def add_vswitch_to_dict(self, vswitch_ip, vswitch_remote_ip, vswitch_ovsdb_port, vswitch_name):
-
         """ Add details of an Open vSwitch instance to self.vswitch_dict
         Args:
             :param vswitch_ip: The ip of Open vSwitch to use