Make sure hash_type is lowercase in master/minion config files

Fixes #32354
This commit is contained in:
rallytime 2016-04-05 09:30:07 -06:00
parent e1ef4a9d66
commit 8b47c205df
2 changed files with 8 additions and 1 deletions

View file

@ -70,7 +70,7 @@ class DaemonsMixin(object): # pylint: disable=no-init
'''
if self.config['hash_type'].lower() in ['md5', 'sha1']:
logger.warning('IMPORTANT: Do not use {h_type} hashing algorithm! Please set "hash_type" to '
'SHA256 in Salt {d_name} config!'.format(
'sha256 in Salt {d_name} config!'.format(
h_type=self.config['hash_type'], d_name=self.__class__.__name__))
def start_log_info(self):

View file

@ -2858,6 +2858,10 @@ def apply_minion_config(overrides=None,
# if there is no schedule option yet, add an empty scheduler
if 'schedule' not in opts:
opts['schedule'] = {}
# Make sure hash_type is lowercase
opts['hash_type'] = opts['hash_type'].lower()
return opts
@ -3004,6 +3008,9 @@ def apply_master_config(overrides=None, defaults=None):
opts.setdefault('pillar_source_merging_strategy', 'smart')
# Make sure hash_type is lowercase
opts['hash_type'] = opts['hash_type'].lower()
return opts