Commits

Vladimir Rusinov committed 95ef26c

pep8 fixes

Comments (0)

Files changed (4)

src/ztc/net/icmp/__init__.py

 #!/usr/bin/env python
-# pylint: disable=W0232
+# pylint: disable-msg=W0232
 """ ZTC net.icmp package
 
 Introduces ping check - can be used to do icmp ping
         retcode, ret = popen(cmd, self.logger)
         if retcode == 0:
             # ping succeed
-            ret = ret.strip().split("\n")[-1]
+            ret = ret.strip().split("\n")[-1]  # pylint: disable-msg=E1103
             # ret is something like
             # rtt min/avg/max/mdev = 33.843/33.843/33.843/0.000 ms
-            ret = ret.split('=')[1].strip()
+            ret = ret.split('=')[1]
+            ret = ret.strip()
             ret = float(ret.split('/')[0])
             return ret / 1000
         else:

src/ztc/nginx/timelog.py

         mn = max(0, mn)
         mx = max(0, mx)
 
-        return {
-                'min': mn,
+        return {'min': mn,
                 'max': mx,
-                'avg': avg
-                }
+                'avg': avg}
 
     def save_to_store(self, data):
         st = ZTCStore('nginx_reqtime', self.options)

src/ztc/pgsql/pg_controldata.py

 #!/usr/bin/env python
 """
 PgDB class - ZTCCheck for tracking single postgresql database
-    
+
 Copyright (c) 2012 Wrike, Inc. [http://www.wrike.com]
 
 Requirements:
 from ztc.check import ZTCCheck, CheckFail
 import ztc.myos
 
+
 class PgControldata(ZTCCheck):
     """ pg_controldata related checks """
-    
+
     name = 'pgsql'
-    
+
     OPTPARSE_MIN_NUMBER_OF_ARGS = 1
     OPTPARSE_MAX_NUMBER_OF_ARGS = 1
-    
+
     def _get(self, metric, *args, **kwargs):
         if metric == 'last_checkpoint_age':
             return self.get_last_checkpoint_age()
         else:
             raise CheckFail('uncknown metric %s' % metric)
-    
+
     def get_last_checkpoint_age(self):
         """ return age of last checkpoint """
         pgdir = self.config.get('pgdata', '/var/lib/pgsql/data')
 
         if not date_str:
             # no 'Time of latest checkpoint' found in pg_controldata output
-            raise CheckFail("no 'Time of latest checkpoint' info found in pg_controldata output")
+            raise CheckFail("no 'Time of latest checkpoint' "
+                            "info found in pg_controldata output")
 
         date = time.mktime(time.strptime(date_str))
         return time.time() - date

src/ztc/pgsql/pgcluster.py

             'host': self.config.get('host', None),  # none = connect via socket
             'user': self.config.get('user', 'postgres'),
             'password': self.config.get('password', None),
-            'database': self.config.get('database', 'postgres')
-        }
+            'database': self.config.get('database', 'postgres')}
         d = PgConn(connect_dict, self.logger)
         dbs = d.query("SELECT datname FROM pg_database")
         self.dbs = [x[0] for x in dbs]
             'host': self.config.get('host', None),  # none = connect via socket
             'user': self.config.get('user', 'postgres'),
             'password': self.config.get('password', None),
-            'database': self.config.get('database', 'postgres')
-        }
+            'database': self.config.get('database', 'postgres')}
 
         ret = {}
         if not self.dbs: