Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the _rule_id and var access in template.py of pam_account_password_faillock #12778

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading