Skip to content

Commit

Permalink
Only warn if key is actually insecure
Browse files Browse the repository at this point in the history
  • Loading branch information
MKLeb authored and Megan Wilhite committed Nov 4, 2022
1 parent 77c1dec commit 3207bf4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions salt/states/pkgrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,14 @@ def managed(name, ppa=None, copr=None, aptkey=True, **kwargs):

# To be changed in version 3008: default to False and still log a warning
allow_insecure_key = kwargs.pop("allow_insecure_key", True)
if allow_insecure_key:
salt.utils.versions.warn_until(
3008,
"allow_insecure_key will default to False starting in salt 3008.",
)
else:
if kwargs.get("key_url", "").strip().startswith("http:"):
key_is_insecure = kwargs.get("key_url", "").strip().startswith("http:")
if key_is_insecure:
if allow_insecure_key:
salt.utils.versions.warn_until(
3008,
"allow_insecure_key will default to False starting in salt 3008.",
)
else:
ret["result"] = False
ret[
"comment"
Expand Down

0 comments on commit 3207bf4

Please sign in to comment.