From 53fdf0bf97c497ce0cc9469d232d304d8625b9e6 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Tue, 1 Dec 2015 11:59:12 -0500 Subject: [PATCH] Update message for invalid source_hash --- salt/modules/file.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/salt/modules/file.py b/salt/modules/file.py index 2664c215f4..635c8634de 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -3358,18 +3358,19 @@ def get_managed( source_hash) source_sum = extract_hash(hash_fn, '', name) if source_sum is None: - return '', {}, ('Source hash file {0} contains an invalid ' - 'hash format, it must be in the format =.' - ).format(source_hash) + return '', {}, ('Source hash {0} format is invalid. It ' + 'must be in the format, =, or it ' + 'must be a supported protocol: {1}' + ).format(source_hash, ', '.join(protos)) else: # The source_hash is a hash string comps = source_hash.split('=') if len(comps) < 2: - return '', {}, ('Source hash file {0} contains an ' - 'invalid hash format, it must be in ' - 'the format =' - ).format(source_hash) + return '', {}, ('Source hash {0} format is invalid. It ' + 'must be in the format, =, or it ' + 'must be a supported protocol: {1}' + ).format(source_hash, ', '.join(protos)) source_sum['hsum'] = comps[1].strip() source_sum['hash_type'] = comps[0].strip() else: