cfn-check 0.6.1__py3-none-any.whl → 0.6.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cfn-check might be problematic. Click here for more details.
- cfn_check/cli/render.py +3 -1
- cfn_check/rendering/renderer.py +6 -29
- {cfn_check-0.6.1.dist-info → cfn_check-0.6.2.dist-info}/METADATA +1 -1
- {cfn_check-0.6.1.dist-info → cfn_check-0.6.2.dist-info}/RECORD +8 -8
- {cfn_check-0.6.1.dist-info → cfn_check-0.6.2.dist-info}/WHEEL +0 -0
- {cfn_check-0.6.1.dist-info → cfn_check-0.6.2.dist-info}/entry_points.txt +0 -0
- {cfn_check-0.6.1.dist-info → cfn_check-0.6.2.dist-info}/licenses/LICENSE +0 -0
- {cfn_check-0.6.1.dist-info → cfn_check-0.6.2.dist-info}/top_level.txt +0 -0
cfn_check/cli/render.py
CHANGED
cfn_check/rendering/renderer.py
CHANGED
|
@@ -165,7 +165,9 @@ class Renderer:
|
|
|
165
165
|
def _assemble_parameters(self, resources: YamlObject):
|
|
166
166
|
params: dict[str, Data] = resources.get("Parameters", {})
|
|
167
167
|
for param_name, param in params.items():
|
|
168
|
-
if
|
|
168
|
+
if isinstance(param, CommentedMap) and (
|
|
169
|
+
default := param.get("Default")
|
|
170
|
+
):
|
|
169
171
|
self._parameters_with_defaults[param_name] = default
|
|
170
172
|
|
|
171
173
|
def _resolve_tagged(self, root: CommentedMap, node: TaggedScalar | CommentedMap | CommentedSeq):
|
|
@@ -504,6 +506,8 @@ class Renderer:
|
|
|
504
506
|
):
|
|
505
507
|
condition_key = self._resolve_subtree(root, condition_key)
|
|
506
508
|
|
|
509
|
+
result = self._resolve_subtree(root, self._conditions.get(condition_key))
|
|
510
|
+
|
|
507
511
|
true_result = source[1]
|
|
508
512
|
if isinstance(
|
|
509
513
|
true_result,
|
|
@@ -512,35 +516,8 @@ class Renderer:
|
|
|
512
516
|
true_result = self._resolve_subtree(root, true_result)
|
|
513
517
|
|
|
514
518
|
false_result = source[2]
|
|
515
|
-
if isinstance(
|
|
516
|
-
true_result,
|
|
517
|
-
(CommentedMap, CommentedSeq, TaggedScalar),
|
|
518
|
-
):
|
|
519
|
-
false_result = self._resolve_subtree(root, false_result)
|
|
520
|
-
|
|
521
|
-
if (
|
|
522
|
-
condition := self._conditions.get(condition_key)
|
|
523
|
-
) and isinstance(
|
|
524
|
-
condition,
|
|
525
|
-
(CommentedMap, CommentedSeq, TaggedScalar)
|
|
526
|
-
) and (
|
|
527
|
-
result := self._resolve_subtree(root, condition)
|
|
528
|
-
) and isinstance(
|
|
529
|
-
result,
|
|
530
|
-
bool,
|
|
531
|
-
):
|
|
532
|
-
|
|
533
|
-
return true_result if result else False
|
|
534
|
-
|
|
535
|
-
elif (
|
|
536
|
-
condition := self._conditions.get(condition_key)
|
|
537
|
-
) and isinstance(
|
|
538
|
-
condition,
|
|
539
|
-
bool,
|
|
540
|
-
):
|
|
541
|
-
return true_result if condition else False
|
|
542
519
|
|
|
543
|
-
return
|
|
520
|
+
return true_result if isinstance(result, bool) and result else false_result
|
|
544
521
|
|
|
545
522
|
def _resolve_condition(
|
|
546
523
|
self,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
cfn_check/__init__.py,sha256=ccUo2YxBmuEmak1M5o-8J0ECLXNkDDUsLJ4mkm31GvU,96
|
|
2
2
|
cfn_check/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
cfn_check/cli/render.py,sha256=
|
|
3
|
+
cfn_check/cli/render.py,sha256=7CuXd9e3JdbLxFcd0Yn7Die8XiVAyOUprgi_CFJERak,2232
|
|
4
4
|
cfn_check/cli/root.py,sha256=Fi-G3nP-HQMY4iPenF2xnkQF798x5cNWDqJZs9TH66A,1727
|
|
5
5
|
cfn_check/cli/validate.py,sha256=aQF-hCC7vcOpu5VNSkoM8DmrB2hZCgciQvFBHIrpnPc,2178
|
|
6
6
|
cfn_check/cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -19,7 +19,7 @@ cfn_check/evaluation/parsing/token_type.py,sha256=E5AVBerinBszMLjjc7ejwSSWEc0p0J
|
|
|
19
19
|
cfn_check/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
cfn_check/logging/models.py,sha256=-tBaK6p8mJ0cO8h2keEJ-VmtFX_VW4XzwAw2PtqbkF0,490
|
|
21
21
|
cfn_check/rendering/__init__.py,sha256=atcbddYun4YHyY7bVGA9CgEYzzXpYzvkx9_Kg-gnD5w,42
|
|
22
|
-
cfn_check/rendering/renderer.py,sha256=
|
|
22
|
+
cfn_check/rendering/renderer.py,sha256=eYIYIVBbkbwWqnP7wxS7C_f4DD7tL8Izo4tfvwVA_rk,30812
|
|
23
23
|
cfn_check/rendering/utils.py,sha256=MNaKePylbJ9Bs4kjuoV0PpCmPJYttPXXvKQILemCrUI,489
|
|
24
24
|
cfn_check/rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
cfn_check/rules/rule.py,sha256=_cKNQ5ciJgPj-exmtBUz31cU2lxWYxw2n2NWIlhYc3s,635
|
|
@@ -27,13 +27,13 @@ cfn_check/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
|
27
27
|
cfn_check/shared/types.py,sha256=-om3DyZsjK_tJd-I8SITkoE55W0nB2WA3LOc87Cs7xI,414
|
|
28
28
|
cfn_check/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
29
|
cfn_check/validation/validator.py,sha256=Z6S6T_4yQW1IUa5Kv3ohR9U8NDrhTvBadW2FEM8TRL8,1478
|
|
30
|
-
cfn_check-0.6.
|
|
30
|
+
cfn_check-0.6.2.dist-info/licenses/LICENSE,sha256=EbCpGNzOkyQ53ig7J2Iwgmy4Og0dgHe8COo3WylhIKk,1069
|
|
31
31
|
example/multitag.py,sha256=QQfcRERGEDgTUCGqWRqRbXHrLwSX4jEOFq8ED4NJnz8,636
|
|
32
32
|
example/pydantic_rules.py,sha256=6NFtDiaqmnYWt6oZIWB7AO_v5LJoZVOGXrmEe2_J_rI,4162
|
|
33
33
|
example/renderer_test.py,sha256=XG5PVTSHztYXHrBw4bpwVuuYt1JNZdtLGJ-DZ9wPjFM,741
|
|
34
34
|
example/rules.py,sha256=mWHB0DK283lb0CeSHgnyO5qiVTJJpybuwWXb4Yoa3zQ,3148
|
|
35
|
-
cfn_check-0.6.
|
|
36
|
-
cfn_check-0.6.
|
|
37
|
-
cfn_check-0.6.
|
|
38
|
-
cfn_check-0.6.
|
|
39
|
-
cfn_check-0.6.
|
|
35
|
+
cfn_check-0.6.2.dist-info/METADATA,sha256=-7DN9EqCSg1J-BrS2-0S-vqkwmWKDncCpzjsmqrW5Jg,20459
|
|
36
|
+
cfn_check-0.6.2.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
37
|
+
cfn_check-0.6.2.dist-info/entry_points.txt,sha256=B4lCHoDHmwisABxKgRLShwqqFv7QwwDAFXoAChOnkwg,53
|
|
38
|
+
cfn_check-0.6.2.dist-info/top_level.txt,sha256=hUn9Ya50yY1fpgWxEhG5iMgfMDDVX7qWQnM1xrgZnhM,18
|
|
39
|
+
cfn_check-0.6.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|