Skip to content

Commit

Permalink
Handle missing name
Browse files Browse the repository at this point in the history
  • Loading branch information
Tehnix committed May 24, 2022
1 parent 418cb22 commit 7220cab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ def report_cost(group_by: str = "SERVICE", length: int = 5, result: dict = None,
if "AccountAliases" in aliases and len(aliases["AccountAliases"]) > 0:
account_name = aliases["AccountAliases"][0]

if account_name is None:
if account_name is None or account_name == "":
account_name = boto3.client("sts").get_caller_identity().get("Account")

if account_name is None:
if account_name is None or account_name == "":
account_name = "[NOT FOUND]"

client = boto3.client('ce')
Expand Down

0 comments on commit 7220cab

Please sign in to comment.