diff --git a/ceph/ceph/files/ceph-manage-journal.py b/ceph/ceph/files/ceph-manage-journal.py index 5ce1dfa87..d75f72bf0 100644 --- a/ceph/ceph/files/ceph-manage-journal.py +++ b/ceph/ceph/files/ceph-manage-journal.py @@ -123,8 +123,8 @@ def create_partitions(disk_path, partition_sizes): # GPT partitions on the storage node so nothing to remove in this case links = [] if os.path.isdir(DISK_BY_PARTUUID): - links = [ os.path.join(DISK_BY_PARTUUID,l) for l in os.listdir(DISK_BY_PARTUUID) - if os.path.islink(os.path.join(DISK_BY_PARTUUID, l)) ] + links = [ os.path.join(DISK_BY_PARTUUID,l) for l in os.listdir(DISK_BY_PARTUUID) + if os.path.islink(os.path.join(DISK_BY_PARTUUID, l)) ] # Erase all partitions on current node by creating a new GPT table _, err, ret = command(["parted", "-s", disk_node, "mktable", "gpt"]) diff --git a/tools/engtools/hostdata-collectors/scripts/live_stream.py b/tools/engtools/hostdata-collectors/scripts/live_stream.py index 05244e74b..486c8f925 100644 --- a/tools/engtools/hostdata-collectors/scripts/live_stream.py +++ b/tools/engtools/hostdata-collectors/scripts/live_stream.py @@ -663,13 +663,13 @@ def collectPostgres(influx_info, node, ci): fields1["dead_tuples"] = int(elements[6]) influx_string1 += "{},'{}'='{}','{}'='{}','{}'='{}','{}'='{}' '{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}'".format(measurement1, "node", tags["node"], "service", tags["service"], "table_schema", tags["table_schema"], "table", tags["table"], "table_size", fields1["table_size"], "index_size", fields1["index_size"], "total_size", fields1["total_size"], "live_tuples", fields1["live_tuples"], "dead_tuples", fields1["dead_tuples"]) + "\n" good_string = True - dbcount += 1 - if dbcount == BATCH_SIZE and good_string: - # Curl will barf if the batch is too large - p = Popen("curl -s -o /dev/null 'http://'{}':'{}'/write?db='{}'' --data-binary '{}'".format(influx_info[0], influx_info[1], influx_info[2], influx_string1), shell=True) - p.communicate() - influx_string1 = "" - dbcount = 0 + dbcount += 1 + if dbcount == BATCH_SIZE and good_string: + # Curl will barf if the batch is too large + p = Popen("curl -s -o /dev/null 'http://'{}':'{}'/write?db='{}'' --data-binary '{}'".format(influx_info[0], influx_info[1], influx_info[2], influx_string1), shell=True) + p.communicate() + influx_string1 = "" + dbcount = 0 if good_string: # send table data to InfluxDB p = Popen("curl -s -o /dev/null 'http://'{}':'{}'/write?db='{}'' --data-binary '{}'".format(influx_info[0], influx_info[1], influx_info[2], influx_string), shell=True) diff --git a/tox.ini b/tox.ini index 7458a5d33..f305de9c6 100644 --- a/tox.ini +++ b/tox.ini @@ -37,7 +37,6 @@ commands = [flake8] # E series are pep8 -# E101 indentation contains mixed spaces and tabs # E121 continuation line under-indented for hanging indent # E123 closing bracket does not match indentation of opening bracket's line # E124 closing bracket does not match visual indentation @@ -92,7 +91,7 @@ commands = # F series # F401 'module' imported but unused # F841 local variable '_alarm_state' is assigned to but never used -ignore = E101,E121,E123,E124,E125,E126,E127,E128,E201,E202,E203,E211,E221,E222,E225,E226,E231,E251,E261,E265,E266, +ignore = E121,E123,E124,E125,E126,E127,E128,E201,E202,E203,E211,E221,E222,E225,E226,E231,E251,E261,E265,E266, E302,E303,E305,E402,E501,E711,E722,E741,E999, H101,H102,H104,H201,H238,H233,H237,H306,H401,H404,H405, W191,W291,W391,W503,