Skip to content

Commit

Permalink
Fix x509_v2 unknown salt-internal kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb authored and Megan Wilhite committed May 10, 2023
1 parent 816fdb8 commit afaa9e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog/64232.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed x509_v2 `create_private_key`/`create_crl` unknown kwargs: __pub_fun...
12 changes: 8 additions & 4 deletions salt/modules/x509_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,8 +901,11 @@ def create_crl(
salt.utils.versions.kwargs_warn_until(["text"], "Potassium")
kwargs.pop("text")

if kwargs:
raise SaltInvocationError(f"Unrecognized keyword arguments: {list(kwargs)}")
unknown = [kwarg for kwarg in kwargs if not kwarg.startswith("_")]
if unknown:
raise SaltInvocationError(
f"Unrecognized keyword arguments: {list(unknown)}"
)

if days_valid is None:
try:
Expand Down Expand Up @@ -1235,8 +1238,9 @@ def create_private_key(
for x in ignored_params:
kwargs.pop(x)

if kwargs:
raise SaltInvocationError(f"Unrecognized keyword arguments: {list(kwargs)}")
unknown = [kwarg for kwarg in kwargs if not kwarg.startswith("_")]
if unknown:
raise SaltInvocationError(f"Unrecognized keyword arguments: {list(unknown)}")

if encoding not in ["der", "pem", "pkcs12"]:
raise CommandExecutionError(
Expand Down

0 comments on commit afaa9e5

Please sign in to comment.