mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 02:18:08 +00:00
Fix python style issues reported by flake8
Additionally some python2-only "print" statements are now compatible with python3.
This commit is contained in:
parent
73f885e382
commit
7063330e03
17 changed files with 102 additions and 103 deletions
|
@ -100,7 +100,7 @@ def parse(clients):
|
|||
|
||||
# Get the current bytes
|
||||
if line.endswith(" is running."):
|
||||
bytes_count_text = input_lines[pos+2].split()[1].split("=")[1].replace(",", "")
|
||||
bytes_count_text = input_lines[pos + 2].split()[1].split("=")[1].replace(",", "")
|
||||
try:
|
||||
# python2
|
||||
bytes_count = long(bytes_count_text)
|
||||
|
@ -126,8 +126,8 @@ def print_config():
|
|||
print("graph_category backup")
|
||||
print("graph_order", " ".join(fd[1] for fd in clients))
|
||||
print()
|
||||
if ((os.getenv("report_hostname") is not None) and
|
||||
(os.getenv("report_hostname").upper() in ["YES", "TRUE", "1", "Y"])):
|
||||
if ((os.getenv("report_hostname") is not None)
|
||||
and (os.getenv("report_hostname").upper() in ["YES", "TRUE", "1", "Y"])):
|
||||
print("host_name", hostname)
|
||||
for client in clients:
|
||||
print("%s.label %s" % (client[1], client[0]))
|
||||
|
|
|
@ -91,7 +91,7 @@ def parse():
|
|||
|
||||
# Get the current bytes
|
||||
if input_lines[pos].endswith("is mounted with:"):
|
||||
bytes_count_text = input_lines[pos+5].split()[1].split("=")[1].replace(",", "")
|
||||
bytes_count_text = input_lines[pos + 5].split()[1].split("=")[1].replace(",", "")
|
||||
try:
|
||||
bytes_count = long(bytes_count_text)
|
||||
except NameError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue