just some coding style fixes

This commit is contained in:
Johannes Findeisen 2013-05-24 03:12:06 +02:00
commit b17283b305

View file

@ -9,7 +9,6 @@ import logging
import subprocess as sp
def parseArgs():
parser = argparse.ArgumentParser(
description="Linspector is for monitoring the vital information of hosts, services and devices in a network.",
@ -26,7 +25,6 @@ def parseArgs():
parser.add_argument("-p", "--pidfile", default="./tmp/linspector.pid", metavar="FILE",
help="set the pidfile to use (default: /tmp/linspector.pid)")
output = parser.add_mutually_exclusive_group()
output.add_argument("-q", "--quiet", action="store_const", dest="loglevel", const=logging.ERROR,
help="output only errors")
@ -39,6 +37,7 @@ def parseArgs():
output.set_defaults(loglevel=logging.INFO)
return parser.parse_args()
def main():
args = parseArgs()
log = Logger(args.logfile, args.loglevel)
@ -55,20 +54,13 @@ def main():
log.i("stopping linspector is currently unsupported")
elif args.action == "restart":
sp.call("./linspector stop")
sp.call("./linspector start --config " + args.config + " --logfile " + args.logfile + " --pidfile " + args.pidfile)
sp.call(
"./linspector start --config " + args.config + " --logfile " + args.logfile + " --pidfile " + args.pidfile)
elif args.action == "attach":
log.i("attaching linspector is currently unsupported")
log.close()
if __name__ == "__main__":
main()