Skip to content

Commit

Permalink
align views
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov-aws committed Nov 5, 2023
1 parent f6800d0 commit 83b054c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
26 changes: 9 additions & 17 deletions cid/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,29 +951,21 @@ def check_dashboard_version_compatibility(self, dashboard_id):
cid_version_latest = "N/A"

if dashboard.latest:
print("You are up to date!")
print(f" CID Version {cid_version}")
print(f" TemplateVersion {dashboard.deployed_version} ")

logger.debug("The dashboard is up-to-date")
logger.debug(f"CID Version {cid_version}")
logger.debug(f"TemplateVersion {dashboard.deployed_version} ")
cid_print("You are up to date!")
cid_print(f" Version {cid_version}")
cid_print(f" VersionId {dashboard.deployed_version} ")
else:
print(f"An update is available:")
print(" Deployed -> Latest")
print(f" CID Version {str(cid_version): <9} {str(cid_version_latest): <6}")
print(f" TemplateVersion {str(dashboard.deployedTemplate.version): <9} {dashboard.latest_version: <6}")

logger.debug("An update is available")
logger.debug(f"CID Version {str(cid_version): <9} --> {str(cid_version_latest): <6}")
logger.debug(f"TemplateVersion {str(dashboard.deployedTemplate.version): <9} --> {dashboard.latest_version: <6}")
cid_print(f"An update is available:")
cid_print(" Deployed -> Latest")
cid_print(f" Version {str(cid_version): <9} {str(cid_version_latest): <9}")
cid_print(f" VersionId {str(dashboard.deployedTemplate.version): <9} {dashboard.latest_version: <9}")

# Check if version are compatible
compatible = None
try:
compatible = dashboard.sourceTemplate.cid_version.compatible_versions(dashboard.deployedTemplate.cid_version)
except ValueError as e:
logger.info(e)
except ValueError as exc:
logger.info(exc)

return compatible

Expand Down
11 changes: 1 addition & 10 deletions cid/helpers/quicksight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def discover_data_sources(self) -> None:
except Exception as exc:
logger.debug(exc, exc_info=True)

def discover_dashboards(self, display: bool=False, refresh: bool=False) -> None:
def discover_dashboards(self, refresh: bool=False) -> None:
""" Discover deployed dashboards """
if refresh or self._dashboards is None:
self._dashboards = {}
Expand All @@ -572,15 +572,6 @@ def discover_dashboards(self, display: bool=False, refresh: bool=False) -> None:
self.discover_dashboard(dashboard_id)
# Update progress bar
bar.update(0, 'Complete')
if not display:
return
for dashboard in self._dashboards.values():
if dashboard.health:
health = 'healthy'
else:
health = 'unhealthy'
print(f'\t{dashboard.name} ({dashboard.id}, {health}, {dashboard.status})')


def list_dashboards(self) -> list:
parameters = {
Expand Down

0 comments on commit 83b054c

Please sign in to comment.