Skip to content

Commit

Permalink
better output
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov-aws committed Nov 5, 2023
1 parent ebdff93 commit ac59499
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cid/helpers/quicksight/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ def display_status(self) -> None:
"""Display status of dashboard"""

cid_print('\n<BOLD>Dashboard status:<END>')
cid_print(f" <BOLD>Name (id)<:END> {self.name} ({self.id})")
cid_print(f" <BOLD>Id:<END> {self.id}")
cid_print(f" <BOLD>Name:<END> {self.name}")
cid_print(f" <BOLD>Health:<END> {'<GREEN>healthy<END>' if self.health else '<RED>unhealthy<END>'}")
cid_print(f" <BOLD>Status:<END> {'<GREEN>' + self.status + '<END>' if self.health else '<RED>' + self.status + '<END>'}")

Expand Down Expand Up @@ -133,12 +134,12 @@ def display_status(self) -> None:
cid_print(f" <BOLD>Version:<END> <YELLOW>{str(cid_version): <8} --> {str(cid_version_latest): <8}<END>")
cid_print(f" <BOLD>VersionId:<END> <YELLOW>{str(self.deployed_version): <8} --> {str(self.latest_version): <8}<END>")

cid_print(' Owners:')
cid_print(' <BOLD>Owners:<END>')
try:
permissions = self.qs.get_dashboard_permissions(self.id)
for permission in permissions:
if 'quicksight:UpdateDashboardPermissions' in permission["Actions"]:
cid_print(' ' +permission["Principal"].split('user/default/')[-1])
cid_print(' ' + permission["Principal"].split('user/default/')[-1])
except Exception as exc:
if "AccessDenied" in str(exc):
cid_print(' <RED>AccessDenied<END>')
Expand Down

0 comments on commit ac59499

Please sign in to comment.