|
@@ -33,7 +33,7 @@ import tornado.websocket
|
|
|
from tornado.gen import sleep
|
|
from tornado.gen import sleep
|
|
|
import asyncio
|
|
import asyncio
|
|
|
|
|
|
|
|
-VERSION = '0.9.20'
|
|
|
|
|
|
|
+VERSION = '0.9.21'
|
|
|
|
|
|
|
|
konfig_file = 'config.cfg'
|
|
konfig_file = 'config.cfg'
|
|
|
modal_konfigs = ''
|
|
modal_konfigs = ''
|
|
@@ -137,7 +137,7 @@ def read_config():
|
|
|
ping_forever = to_bool(config["Main"]["PingForever"])
|
|
ping_forever = to_bool(config["Main"]["PingForever"])
|
|
|
except KeyError:
|
|
except KeyError:
|
|
|
pass
|
|
pass
|
|
|
- if args.v: print(sect + ": " + key + " = " + config[sect][key])
|
|
|
|
|
|
|
+ if args.v: print(konfig_file + ": " + sect + ": " + key + " = " + config[sect][key])
|
|
|
else:
|
|
else:
|
|
|
if args.s and sect_file:
|
|
if args.s and sect_file:
|
|
|
return
|
|
return
|
|
@@ -146,13 +146,12 @@ def read_config():
|
|
|
host_dict[key] = sect.replace(' ','_')
|
|
host_dict[key] = sect.replace(' ','_')
|
|
|
failed_pingc[key] = 0
|
|
failed_pingc[key] = 0
|
|
|
anz_hosts += 1
|
|
anz_hosts += 1
|
|
|
- if args.v: print(sect + ": " + key + " = " + config[sect][key])
|
|
|
|
|
|
|
+ if args.v: print(konfig_file + ": " + sect + ": " + key + " = " + config[sect][key])
|
|
|
|
|
|
|
|
def read_sections_config():
|
|
def read_sections_config():
|
|
|
global anz_hosts
|
|
global anz_hosts
|
|
|
- sect_config = configparser.ConfigParser(delimiters=('='), comment_prefixes=('#'), allow_no_value=False, strict=True, empty_lines_in_values=False)
|
|
|
|
|
try:
|
|
try:
|
|
|
- if sect_config.read([sect_file]) != []:
|
|
|
|
|
|
|
+ if config.read([sect_file]) != []:
|
|
|
pass
|
|
pass
|
|
|
else:
|
|
else:
|
|
|
print("Sectionsfile '" + sect_file + "' not found!")
|
|
print("Sectionsfile '" + sect_file + "' not found!")
|
|
@@ -168,15 +167,15 @@ def read_sections_config():
|
|
|
sys.exit()
|
|
sys.exit()
|
|
|
|
|
|
|
|
#print(config.sections())
|
|
#print(config.sections())
|
|
|
- for sect in sect_config.sections():
|
|
|
|
|
|
|
+ for sect in config.sections():
|
|
|
if (sect == "Main"):
|
|
if (sect == "Main"):
|
|
|
continue
|
|
continue
|
|
|
- for key in sect_config[sect]:
|
|
|
|
|
- #host_dict[key] = sect_config[sect][key]
|
|
|
|
|
|
|
+ for key in config[sect]:
|
|
|
|
|
+ #host_dict[key] = config[sect][key]
|
|
|
host_dict[key] = sect.replace(' ','_')
|
|
host_dict[key] = sect.replace(' ','_')
|
|
|
failed_pingc[key] = 0
|
|
failed_pingc[key] = 0
|
|
|
anz_hosts += 1
|
|
anz_hosts += 1
|
|
|
- if args.v: print(sect + ": " + key + " = " + config[sect][key])
|
|
|
|
|
|
|
+ if args.v: print(sect_file + ": " + sect + ": " + key + " = " + config[sect][key])
|
|
|
|
|
|
|
|
def cmd_exists(cmd):
|
|
def cmd_exists(cmd):
|
|
|
path = os.environ["PATH"].split(os.pathsep)
|
|
path = os.environ["PATH"].split(os.pathsep)
|