Skip to content

Commit

Permalink
Merge pull request #12778 from alanmcanonical/fix_rule_id_templatepy
Browse files Browse the repository at this point in the history
Fix the _rule_id and var access in template.py of pam_account_password_faillock
  • Loading branch information
jan-cerny authored Jan 7, 2025
2 parents 59dbac9 + f92ed0d commit bd7581c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/templates/pam_account_password_faillock/template.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def preprocess(data, lang):
if data.get("ext_variable") is None:
errmsg = ("The template instance of the rule {0} requires the "
"ext_variable to be defined".format(_rule_id))
"ext_variable to be defined".format(data["_rule_id"]))
raise ValueError(errmsg)

for var in ["variable_upper_bound", "variable_lower_bound"]:
Expand All @@ -11,6 +11,6 @@ def preprocess(data, lang):
type(data.get(var)) != int:
errmsg = ("The template instance of the rule {0} requires the "
"parameter {1} is either 'use_ext_variable' or "
"a number or undefined".formate(_rule_id, var))
"a number or undefined".format(data["_rule_id"], data["var"]))
raise ValueError(errmsg)
return data

0 comments on commit bd7581c

Please sign in to comment.