From 92a96343e10283218b4d3c4f3232fc9fec4b27aa Mon Sep 17 00:00:00 2001 From: Marcus Stoegbauer Date: Wed, 3 Jul 2019 22:53:49 +0200 Subject: [PATCH] add reverse flag to userconfig.cfg to turn around classes (host last) --- userconfig.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/userconfig.py b/userconfig.py index 601295e..84f6255 100755 --- a/userconfig.py +++ b/userconfig.py @@ -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]