From d36637489f998da5dc1295d50e7905a8f13f6783 Mon Sep 17 00:00:00 2001 From: Voicu <99695945+VoicuAWS@users.noreply.github.com> Date: Thu, 27 Feb 2025 00:57:38 -0800 Subject: [PATCH] minor logging fixes (#1136) --- cid/helpers/cur.py | 2 +- cid/helpers/glue.py | 2 +- cid/helpers/iam.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cid/helpers/cur.py b/cid/helpers/cur.py index 0cf5f059..885bbf86 100644 --- a/cid/helpers/cur.py +++ b/cid/helpers/cur.py @@ -222,7 +222,7 @@ def find_cur(self): try: metadata = self.athena.get_table_metadata(table_name, cur_database) except self.athena.client.exceptions.MetadataException as exc: - raise CidCritical(f'Provided cur-table-name "{table_name}" in database "{cur_database or self.athena.DatabaseName}" is not found. Please make sure the table exists.') from exc + raise CidCritical(f'Provided cur-table-name "{table_name}" in database "{cur_database or self.athena.DatabaseName}" is not found. Please make sure the table exists. This could also indicate a LakeFormation permission issue, see our FAQ for help.') from exc res, message = self.table_is_cur(table=metadata, return_reason=True) if not res: raise CidCritical(f'Table {table_name} does not look like CUR. {message}') diff --git a/cid/helpers/glue.py b/cid/helpers/glue.py index f051a939..28261e2a 100644 --- a/cid/helpers/glue.py +++ b/cid/helpers/glue.py @@ -73,7 +73,7 @@ def create_or_update_crawler(self, crawler_definition) -> None: self.client.update_crawler(**crawler_definition) except self.client.exceptions.ClientError as exc: if 'Service is unable to assume provided role' in str(exc): - logger.info('attempt{attempt}: Retrying ') # sometimes newly created roles cannot be assumed right away + logger.info(f'attempt{attempt}: Retrying ') # sometimes newly created roles cannot be assumed right away time.sleep(3) continue logger.error(crawler_definition) diff --git a/cid/helpers/iam.py b/cid/helpers/iam.py index 5b2d806a..1e0f46c3 100644 --- a/cid/helpers/iam.py +++ b/cid/helpers/iam.py @@ -71,7 +71,7 @@ def ensure_managed_policies_attached(self, role_name, policies_arns='') -> None: RoleName=role_name, PolicyArn=policy_arn, ) - logger.info('Attached {policy_arn} to the role {role_name}') + logger.info(f'Attached {policy_arn} to the role {role_name}') except self.client.exceptions.ClientError as exc: logger.warning(f'Unable to attach policy {policy_arn} to {role_name}: {exc}')