2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Fix import error messages and a tab

This commit is contained in:
daftaupe 2017-06-24 18:33:56 +02:00
parent f14887f5c8
commit ec2d1fea94

View File

@ -58,10 +58,15 @@ import json
import os
import sys
import GeoIP
import stem
import stem.control
import stem.connection
try:
import GeoIP
import stem
import stem.control
import stem.connection
except ImportError:
# missing dependencies are reported via "autoconf"
# thus failure is acceptable here
pass
default_torcachefile = 'munin_tor_country_stats.json'
default_torconnectmethod = 'port'
@ -141,7 +146,7 @@ class TorPlugin(object):
import stem
except ImportError as e:
print('no ({})'.format(e))
print('no (failed to import the required python module "stem": {})'.format(e))
try:
import GeoIP
@ -528,7 +533,7 @@ def main():
provider.fetch()
else:
print('Unknown parameter "{}"'.format(param), file=sys.stderr)
sys.exit(1)
sys.exit(1)
if __name__ == '__main__':
main()