fix wintask.info: ExecutionTimeLimit and unknown values

ExecutionTimeLimit: can be nothing or "PT0S" if not used
_reverse_lookup: if not found, return "invalid value" instead of the last dict element
This commit is contained in:
hurzhurz 2024-04-26 09:48:47 +02:00
parent eedcf490af
commit c2a6550bc1

View file

@ -253,6 +253,8 @@ def _reverse_lookup(dictionary, value):
value_index = idx
break
if value_index < 0:
return "invalid value"
return list(dictionary)[value_index]
@ -1494,7 +1496,7 @@ def info(name, location="\\"):
duration, def_set.DeleteExpiredTaskAfter
)
if def_set.ExecutionTimeLimit == "":
if def_set.ExecutionTimeLimit == "" or def_set.ExecutionTimeLimit == "PT0S":
settings["execution_time_limit"] = False
else:
settings["execution_time_limit"] = _reverse_lookup(