From 0b34e6db18ebe5b4a36a0b48c58723fc4ff02133 Mon Sep 17 00:00:00 2001 From: Jonathan Loscalzo Date: Tue, 16 May 2023 16:30:52 -0300 Subject: [PATCH] remove account's id and name from variables, if empty exclude it --- iambic/plugins/v0_1_0/aws/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/iambic/plugins/v0_1_0/aws/models.py b/iambic/plugins/v0_1_0/aws/models.py index 97bc980d3..b820eb91a 100644 --- a/iambic/plugins/v0_1_0/aws/models.py +++ b/iambic/plugins/v0_1_0/aws/models.py @@ -479,6 +479,17 @@ def dict( exclude_defaults=exclude_defaults, exclude_none=exclude_none, ) + + if "variables" in resp: + resp["variables"] = [ + i + for i in resp.get("variables", []) + if i.get("key") not in ["account_id", "account_name"] + ] + + if resp["variables"] == []: + resp.pop("variables") + return sort_dict( resp, [