@@ -53,30 +53,30 @@ def match(self, cfn):
53
53
list_of_objs = select_value_obj [1 ]
54
54
if isinstance (index_obj , dict ):
55
55
if len (index_obj ) == 1 :
56
- for index_key , _ in index_obj :
56
+ for index_key , _ in index_obj . items () :
57
57
if index_key not in ['Ref' , 'Fn::FindInMap' ]:
58
- message = 'Select index should be int, Ref, FindInMap for {0}'
58
+ message = 'Select index should be an Integer or a function Ref or FindInMap for {0}'
59
59
matches .append (RuleMatch (
60
60
tree , message .format ('/' .join (map (str , tree )))))
61
61
elif not isinstance (index_obj , six .integer_types ):
62
62
try :
63
63
int (index_obj )
64
64
except ValueError :
65
- message = 'Select index should be int, Ref, FindInMap for {0}'
65
+ message = 'Select index should be an Integer or a function of Ref or FindInMap for {0}'
66
66
matches .append (RuleMatch (
67
67
tree , message .format ('/' .join (map (str , tree )))))
68
68
if isinstance (list_of_objs , dict ):
69
69
if len (list_of_objs ) == 1 :
70
70
for key , _ in list_of_objs .items ():
71
71
if key not in supported_functions :
72
- message = 'Key {0} should be a list for {1 }'
72
+ message = 'Select should use a supported function of {0 }'
73
73
matches .append (RuleMatch (
74
- tree , message .format (key , '/' .join (map (str , tree )))))
74
+ tree , message .format (' , ' .join (map (str , supported_functions )))))
75
75
else :
76
- message = 'Select should be a list of 2 elements for {0}'
76
+ message = 'Select should use a supported function of {0}'
77
77
matches .append (RuleMatch (
78
- tree , message .format ('/ ' .join (map (str , tree )))))
79
- else :
78
+ tree , message .format (', ' .join (map (str , supported_functions )))))
79
+ elif not isinstance ( list_of_objs , list ) :
80
80
message = 'Select should be an array of values for {0}'
81
81
matches .append (RuleMatch (
82
82
tree , message .format ('/' .join (map (str , tree )))))
0 commit comments