add reverse flag to userconfig.cfg to turn around classes (host last)

This commit is contained in:
Marcus Stoegbauer 2019-07-03 22:53:49 +02:00
parent 81d8a074cc
commit 92a96343e1

View File

@ -81,9 +81,16 @@ def workdir(directory):
# key is the destination filename, values are all classes filenames that are used to
# build the file
destfiles = {}
# FIXME: reverse_order should really be a bool in .cfg, implement variable types in cfg file
reverse_sort = False
try:
reverse_sort = (dir_config.get("Main", "reverse") == 'True')
except NoOptionError:
reverse_sort = False
# walk through all know classes in directory and find filenames
for h in classchecks.__classes_for_host__():
for h in classchecks.__classes_for_host__(reverse_sort):
# build classes directory
if h[0] != "":
classdir = directory+"/"+h[0]+"_"+h[1]