Skip to content

Commit

Permalink
[plugins/transmission] Lint
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
  • Loading branch information
shtrom committed Aug 31, 2020
1 parent 897de1b commit 92483a0
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions plugins/network/transmission
Expand Up @@ -76,12 +76,13 @@ find this plugin on github at http://github.com/VolatileMesh/munin-plugins
__version__ = '1.1'


import os, sys
import os
import sys
from string import Template

plugin_name=list(os.path.split(sys.argv[0]))[1]
host = os.getenv('host','localhost')
port = os.getenv('port',9091)
plugin_name = list(os.path.split(sys.argv[0]))[1]
host = os.getenv('host', 'localhost')
port = os.getenv('port', 9091)
user = os.getenv('user')
passwd = os.getenv('pass')
title_host = '' if host in ['localhost', '127.0.0.1', '::1'] else ' on ' + host
Expand Down Expand Up @@ -132,7 +133,6 @@ def autoconf():
print 'no python module \'transmissionrpc\' missing'



def fetch():
import transmissionrpc

Expand Down Expand Up @@ -173,7 +173,6 @@ def print_values_throughput(stats):
print "up.value U"



def dumpstats():
import transmissionrpc
try:
Expand All @@ -186,14 +185,14 @@ def dumpstats():


if __name__ == '__main__':
if len(sys.argv)>1 :
if sys.argv[1]=="dumpstats" :
dumpstats()
elif sys.argv[1]=="config" :
if len(sys.argv) > 1 :
if sys.argv[1] == "dumpstats" :
dumpstats()
elif sys.argv[1] == "config" :
config()
elif sys.argv[1]=="autoconf" :
elif sys.argv[1] == "autoconf" :
autoconf()
elif sys.argv[1]!="":
elif sys.argv[1] != "":
raise ValueError, "unknown parameter '%s'" % sys.argv[1]

fetch()
Expand Down

0 comments on commit 92483a0

Please sign in to comment.