mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +00:00
Fix import error messages and a tab
This commit is contained in:
parent
f14887f5c8
commit
ec2d1fea94
1 changed files with 11 additions and 6 deletions
|
@ -58,10 +58,15 @@ import json
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import GeoIP
|
try:
|
||||||
import stem
|
import GeoIP
|
||||||
import stem.control
|
import stem
|
||||||
import stem.connection
|
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_torcachefile = 'munin_tor_country_stats.json'
|
||||||
default_torconnectmethod = 'port'
|
default_torconnectmethod = 'port'
|
||||||
|
@ -141,7 +146,7 @@ class TorPlugin(object):
|
||||||
import stem
|
import stem
|
||||||
|
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
print('no ({})'.format(e))
|
print('no (failed to import the required python module "stem": {})'.format(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import GeoIP
|
import GeoIP
|
||||||
|
@ -528,7 +533,7 @@ def main():
|
||||||
provider.fetch()
|
provider.fetch()
|
||||||
else:
|
else:
|
||||||
print('Unknown parameter "{}"'.format(param), file=sys.stderr)
|
print('Unknown parameter "{}"'.format(param), file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue