From 67067259c93cf708f4ee94ffc0fbb8bc1996365f Mon Sep 17 00:00:00 2001 From: Iakov GAN <82834333+iakov-aws@users.noreply.github.com> Date: Sat, 23 Nov 2024 13:13:16 +0100 Subject: [PATCH] avoid false error messages on incremental config (#1034) --- cid/helpers/quicksight/__init__.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cid/helpers/quicksight/__init__.py b/cid/helpers/quicksight/__init__.py index 5baff4c4..1e9304a3 100644 --- a/cid/helpers/quicksight/__init__.py +++ b/cid/helpers/quicksight/__init__.py @@ -1272,12 +1272,11 @@ def ensure_dataset_refresh_schedule(self, dataset_id, schedules: list): DataSetRefreshProperties={'RefreshConfiguration': refresh_configuration} ) logger.debug(f'Refresh schedule configuration with id {schedule["ScheduleId"]} for dataset {dataset_id} is updated.') - except self.client.exceptions.ResourceNotFoundException: - logger.error(f'Unable to update refresh schedule configuration with id {schedule["ScheduleId"]}. Dataset {dataset_id} does not exist.') - except self.client.exceptions.AccessDeniedException: - logger.error(f'Unable to update refresh schedule configuration with id {schedule["ScheduleId"]}. Please add quicksight:UpdateDataSet permission.') - except Exception as exc: - logger.error(f'Unable to update refresh schedule configuration with id {schedule["ScheduleId"]} for dataset "{dataset_id}": {str(exc)}') + except self.client.exceptions.ClientError as exc: + if 'configuration provided is same as the existing configuration for the dataset.' in str(exc): + logger.debug('RefreshConfiguration already set') + else: + logger.error(f'Unable to update refresh schedule configuration with id {schedule["ScheduleId"]} for dataset "{dataset_id}": {str(exc)}') # Verify that all schedule parameters are set schedule["ScheduleId"] = schedule.get("ScheduleId", "cid")