Lint: E302 expected 2 blank lines, found X

This commit is contained in:
2020-11-07 14:45:24 -05:00
parent e9643651f7
commit 260b39ebf2
36 changed files with 694 additions and 19 deletions

View File

@ -30,6 +30,7 @@ import daemon_lib.ceph as pvc_ceph
config = None # Set in this namespace by flaskapi
def strtobool(stringv):
if stringv is None:
return False
@ -40,6 +41,7 @@ def strtobool(stringv):
except Exception:
return False
#
# Exceptions (used by Celery tasks)
#
@ -66,6 +68,7 @@ class BenchmarkError(Exception):
# Common functions
#
# Database connections
def open_database(config):
conn = psycopg2.connect(
@ -78,12 +81,14 @@ def open_database(config):
cur = conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
return conn, cur
def close_database(conn, cur, failed=False):
if not failed:
conn.commit()
cur.close()
conn.close()
def list_benchmarks(job=None):
if job is not None:
query = "SELECT * FROM {} WHERE job = %s;".format('storage_benchmarks')
@ -109,6 +114,7 @@ def list_benchmarks(job=None):
else:
return {'message': 'No benchmark found.'}, 404
def run_benchmark(self, pool):
# Runtime imports
import time