diff --git a/cid/common.py b/cid/common.py index ecdff766..f30a46bf 100644 --- a/cid/common.py +++ b/cid/common.py @@ -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 diff --git a/cid/helpers/quicksight/__init__.py b/cid/helpers/quicksight/__init__.py index 7c434518..bbfacce6 100644 --- a/cid/helpers/quicksight/__init__.py +++ b/cid/helpers/quicksight/__init__.py @@ -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 = {} @@ -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 = {