Fix flake8 violations 87/12687/1
authorjose.lausuch <jose.lausuch@ericsson.com>
Tue, 26 Apr 2016 19:45:45 +0000 (21:45 +0200)
committerjose.lausuch <jose.lausuch@ericsson.com>
Tue, 26 Apr 2016 19:46:10 +0000 (21:46 +0200)
Change-Id: Idd0f4bec503578c2f2031cbcdee97ea27d22ac14
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
cli.py
storperf/db/configuration_db.py
storperf/db/job_db.py

diff --git a/cli.py b/cli.py
index 1f20e31..f2fa178 100644 (file)
--- a/cli.py
+++ b/cli.py
@@ -154,7 +154,7 @@ def main(argv=None):
                 raise Usage(content['message'])
 
         if (report is not None):
-            print storperf.fetch_results(report, workloads)
+            print storperf.fetch_results(report, workload)
         else:
             print "Calling start..."
             response = requests.post(
index 700588d..b12394e 100644 (file)
@@ -51,9 +51,9 @@ class ConfigurationDB(object):
             db = sqlite3.connect(ConfigurationDB.db_name)
             cursor = db.cursor()
 
-            cursor.execute(
-                "delete from configuration where configuration_name=? and key=?",
-                (configuration_name, key))
+            cursor.execute("delete from configuration where "
+                           "configuration_name=? and key=?",
+                           (configuration_name, key))
 
             self.logger.debug("Deleted " + configuration_name + ":" + key)
 
@@ -105,9 +105,9 @@ class ConfigurationDB(object):
             db = sqlite3.connect(ConfigurationDB.db_name)
             cursor = db.cursor()
 
-            cursor.execute(
-                "delete from configuration where configuration_name=? and key=?",
-                (configuration_name, key))
+            cursor.execute("delete from configuration where "
+                           "configuration_name=? and key=?",
+                           (configuration_name, key))
 
             cursor.execute(
                 """insert into configuration(configuration_name, key, value)
index 8aa4c11..0e94358 100644 (file)
@@ -110,8 +110,8 @@ class JobDB(object):
                      workload_name,
                      now,))
             else:
-                self.logger.warn("Duplicate start time for workload "
-                                 + workload_name)
+                self.logger.warn("Duplicate start time for workload %s"
+                                 % workload_name)
                 cursor.execute(
                     """update jobs set
                                job_id = ?,
@@ -146,8 +146,8 @@ class JobDB(object):
                 (self.job_id, workload_name,))
 
             if (row.fetchone() is None):
-                self.logger.warn("No start time recorded for workload "
-                                 + workload_name)
+                self.logger.warn("No start time recorded for workload %s"
+                                 % workload_name)
                 cursor.execute(
                     """insert into jobs
                                (job_id,
@@ -207,10 +207,10 @@ class JobDB(object):
                 self.logger.info("workload=" + workload +
                                  "start=" + start_time + " end=" + end_time)
 
-                request = 'http://127.0.0.1:8000/render/?target=*.' + self.job_id + \
-                    '.' + workload + '.jobs.1.*.clat.mean&format=json&from=' + \
-                    start_time + "&until=" + end_time
-
+                request = ("http://127.0.0.1:8000/render/?target="
+                           "*.%s.%s.jobs.1.*.clat.mean"
+                           "&format=json&from=%s&until=%s"
+                           % (self.job_id, workload, start_time, end_time))
                 response = requests.get(request)
 
                 if (response.status_code == 200):