mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
eedcf490af
commit
c2a6550bc1
1 changed files with 3 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Reference in a new issue