mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +00:00
Fix multiple python code issues (detected by flake8)
This commit is contained in:
parent
7fed3b9765
commit
be192b5226
3 changed files with 3 additions and 3 deletions
|
@ -110,7 +110,7 @@ except ValueError:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
eth = int(etherscan_balance['result'])
|
eth = int(etherscan_balance['result'])
|
||||||
except (KeyError, ValueError) as exc:
|
except (KeyError, ValueError):
|
||||||
print("JSON result error!", file=sys.stderr)
|
print("JSON result error!", file=sys.stderr)
|
||||||
sys.exit(9)
|
sys.exit(9)
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ def get_monit_status_xml():
|
||||||
auth_value = "Basic %s" % auth_base64_str
|
auth_value = "Basic %s" % auth_base64_str
|
||||||
req.add_header("Authorization", auth_value)
|
req.add_header("Authorization", auth_value)
|
||||||
conn = urllib.request.urlopen(req)
|
conn = urllib.request.urlopen(req)
|
||||||
except urllib.error.URLError as exc:
|
except urllib.error.URLError:
|
||||||
conn = None
|
conn = None
|
||||||
if conn is None:
|
if conn is None:
|
||||||
raise RuntimeError("Failed to open monit status URL: {}".format(MONIT_XML_URL))
|
raise RuntimeError("Failed to open monit status URL: {}".format(MONIT_XML_URL))
|
||||||
|
|
|
@ -29,7 +29,7 @@ if len(sys.argv) > 1:
|
||||||
print('%s.label %s' % (name, label))
|
print('%s.label %s' % (name, label))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
re_num = re.compile('(\d+)')
|
re_num = re.compile(r'(\d+)')
|
||||||
sockstat = open('/proc/net/sockstat').read()
|
sockstat = open('/proc/net/sockstat').read()
|
||||||
numbers = re_num.findall(sockstat)
|
numbers = re_num.findall(sockstat)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue