Adding a new system_warnings config option to supress warnings

This commit is contained in:
James Cammarata 2014-04-30 14:44:10 -05:00
commit 6069ff6e9e
4 changed files with 34 additions and 3 deletions

View file

@ -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":