Keep cfnlint import function-local (~1s)

Saves about 1s of startup time.
This commit is contained in:
Stijn Seghers 2020-01-16 12:48:48 +13:00
parent e09dfac95b
commit 1fbf76b95a
No known key found for this signature in database
GPG Key ID: BF6A2BFEA196E7B6

View File

@ -6,7 +6,6 @@ import yaml
import os
import string
from cfnlint import decode, core
from moto.core import ACCOUNT_ID
@ -62,6 +61,8 @@ def yaml_tag_constructor(loader, tag, node):
def validate_template_cfn_lint(template):
# Importing cfnlint adds a significant overhead, so we keep it local
from cfnlint import decode, core
# Save the template to a temporary file -- cfn-lint requires a file
filename = "file.tmp"