mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
Adding a new system_warnings config option to supress warnings
This commit is contained in:
parent
bf7c51ad8a
commit
6069ff6e9e
4 changed files with 34 additions and 3 deletions
|
@ -44,7 +44,6 @@ import getpass
|
|||
import sys
|
||||
import textwrap
|
||||
import json
|
||||
import warnings
|
||||
|
||||
#import vault
|
||||
from vault import VaultLib
|
||||
|
@ -83,8 +82,11 @@ try:
|
|||
import keyczar.errors as key_errors
|
||||
from keyczar.keys import AesKey
|
||||
except PowmInsecureWarning:
|
||||
display("The version of gmp you have installed has a known issue regarding timing vulnerabilities when used with pycrypto. " + \
|
||||
"If possible, you should update it (ie. yum update gmp).", color="purple", stderr=True)
|
||||
system_warning(
|
||||
"The version of gmp you have installed has a known issue regarding " + \
|
||||
"timing vulnerabilities when used with pycrypto. " + \
|
||||
"If possible, you should update it (ie. yum update gmp)."
|
||||
)
|
||||
warnings.resetwarnings()
|
||||
warnings.simplefilter("ignore")
|
||||
import keyczar.errors as key_errors
|
||||
|
@ -1155,6 +1157,10 @@ def warning(msg):
|
|||
display(new_msg, color='bright purple', stderr=True)
|
||||
warns[new_msg] = 1
|
||||
|
||||
def system_warning(msg):
|
||||
if C.SYSTEM_WARNINGS:
|
||||
warning(msg)
|
||||
|
||||
def combine_vars(a, b):
|
||||
|
||||
if C.DEFAULT_HASH_BEHAVIOUR == "merge":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue