Allow validate tests for aws-cfn-lib, check Mode option

This commit is contained in:
Stefan Reimer 2021-03-11 16:38:55 +01:00
parent 21cb87e9ef
commit f6e3df67bb

View File

@ -109,7 +109,7 @@ class Stack(object):
if 'options' in _config:
self.options = dict_merge(self.options, _config['options'])
if 'Mode' in self.options:
if 'Mode' in self.options and self.options['Mode'] == 'Piped':
self.mode = self.options['Mode']
if 'StoreOutputs' in self.options and self.options['StoreOutputs']:
@ -346,8 +346,13 @@ class Stack(object):
(args, filenames, formatter) = cfnlint.core.get_args_filenames(lint_args)
(template, rules, matches) = cfnlint.core.get_template_rules(filename, args)
region = self.region
if region == 'global':
region = 'us-east-1'
if not matches:
matches.extend(cfnlint.core.run_checks(filename, template, rules, [self.region]))
matches.extend(cfnlint.core.run_checks(filename, template, rules, [region]))
if len(matches):
for match in matches:
logger.error(formatter._format(match))