in cid/helpers/quicksight.py [0:0]
def select_dashboard(self, force=False) -> str:
""" Select from a list of discovered dashboards """
selection = list()
dashboard_id = None
for dashboard in self.dashboards.values():
if dashboard.health:
health = 'healthy'
else:
health = 'unhealthy'
selection.append(
questionary.Choice(
title=f'{dashboard.name} ({dashboard.arn}, {health}, {dashboard.status})',
value=dashboard.id,
# Disable if broken or no update available and not forced
disabled=((dashboard.latest or not dashboard.health) and not force)
)
)
try:
dashboard_id = questionary.select(
"Please select installation(s) from the list",
choices=selection
).ask()
except:
print('\nNo updates available or dashboard(s) is/are broken, use --force to allow selection\n')
finally:
return dashboard_id