Skip to content

Commit

Permalink
Fix the _rule_id and var access in template.py
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcanonical committed Jan 6, 2025
1 parent d82db2b commit a5e1e10
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".formate(data["_rule_id"], date["var"]))
raise ValueError(errmsg)
return data

0 comments on commit a5e1e10

Please sign in to comment.