From f6e3df67bb015fc109d406798f0ccc475e75fb96 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Thu, 11 Mar 2021 16:38:55 +0100 Subject: [PATCH] Allow validate tests for aws-cfn-lib, check Mode option --- cloudbender/stack.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cloudbender/stack.py b/cloudbender/stack.py index ee7ff73..1d28063 100644 --- a/cloudbender/stack.py +++ b/cloudbender/stack.py @@ -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))