Keep cfnlint import function-local (~1s)
Saves about 1s of startup time.
This commit is contained in:
parent
e09dfac95b
commit
1fbf76b95a
1 changed files with 2 additions and 1 deletions
|
|
@ -6,7 +6,6 @@ import yaml
|
||||||
import os
|
import os
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from cfnlint import decode, core
|
|
||||||
from moto.core import ACCOUNT_ID
|
from moto.core import ACCOUNT_ID
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -62,6 +61,8 @@ def yaml_tag_constructor(loader, tag, node):
|
||||||
|
|
||||||
|
|
||||||
def validate_template_cfn_lint(template):
|
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
|
# Save the template to a temporary file -- cfn-lint requires a file
|
||||||
filename = "file.tmp"
|
filename = "file.tmp"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue