diff --git a/requirements/base.txt b/requirements/base.txt index 65bbf5ee59..bb4c20f9db 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,7 +6,7 @@ Flask~=1.0.2 boto3~=1.9, >=1.9.56 PyYAML~=3.12 cookiecutter~=1.6.0 -aws-sam-translator==1.9.1 +aws-sam-translator==1.10.0 docker>=3.3.0 dateparser~=0.7 python-dateutil~=2.6 diff --git a/samcli/commands/validate/lib/sam_template_validator.py b/samcli/commands/validate/lib/sam_template_validator.py index 57e46b56b9..773fbf1c0a 100644 --- a/samcli/commands/validate/lib/sam_template_validator.py +++ b/samcli/commands/validate/lib/sam_template_validator.py @@ -59,29 +59,10 @@ def is_valid(self): self._replace_local_codeuri() - # In the Paser class, within the SAM Translator, they log a warning for when the template - # does not match the schema. The logger they use is the root logger instead of one scoped to - # their module. Currently this does not cause templates to fail, so we will suppress this - # by patching the logging.warning method that is used in that class. - class WarningSuppressLogger(object): - - def __init__(self, obj_to_patch): - self.obj_to_patch = obj_to_patch - - def __enter__(self): - self.obj_to_patch.warning = self.warning - - def __exit__(self, exc_type, exc_val, exc_tb): - self.obj_to_patch.warning = self.obj_to_patch.warning - - def warning(self, message): - pass - try: - with WarningSuppressLogger(parser.logging): - template = sam_translator.translate(sam_template=self.sam_template, - parameter_values={}) - LOG.debug("Translated template is:\n%s", yaml_dump(template)) + template = sam_translator.translate(sam_template=self.sam_template, + parameter_values={}) + LOG.debug("Translated template is:\n%s", yaml_dump(template)) except InvalidDocumentException as e: raise InvalidSamDocumentException( functools.reduce(lambda message, error: message + ' ' + str(error), e.causes, str(e)))