Skip to content

Commit fe03b6f

Browse files
committed
minor update to fix return response bug
1 parent d5cbb35 commit fe03b6f

File tree

1 file changed

+3
-3
lines changed
  • aws_sra_examples/solutions/genai/bedrock_org/lambda/src

1 file changed

+3
-3
lines changed

aws_sra_examples/solutions/genai/bedrock_org/lambda/src/sra_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def put_organization_config_rule(self) -> dict:
8787
# Return the response
8888
return response
8989

90-
def find_config_rule(self, rule_name: str) -> tuple[bool, DescribeConfigRulesResponseTypeDef]:
90+
def find_config_rule(self, rule_name: str) -> tuple[bool, dict | DescribeConfigRulesResponseTypeDef]:
9191
"""Get config rule
9292
9393
Args:
@@ -97,7 +97,7 @@ def find_config_rule(self, rule_name: str) -> tuple[bool, DescribeConfigRulesRes
9797
ValueError: If the config rule is not found
9898
9999
Returns:
100-
tuple[bool, dict]: True if the config rule is found, False if not, and the response
100+
tuple[bool, dict | DescribeConfigRulesResponseTypeDef]: True if the config rule is found, False if not, and the response
101101
"""
102102
try:
103103

@@ -109,7 +109,7 @@ def find_config_rule(self, rule_name: str) -> tuple[bool, DescribeConfigRulesRes
109109
except ClientError as e:
110110
if e.response["Error"]["Code"] == "NoSuchConfigRuleException":
111111
self.LOGGER.info(f"No such config rule: {rule_name}")
112-
return False, cast(DescribeConfigRulesResponseTypeDef, {})
112+
return False, {}
113113
else:
114114
self.LOGGER.info(f"Unexpected error: {e}")
115115
raise e

0 commit comments

Comments
 (0)