Skip to content

Commit

Permalink
Merge pull request #138 from aws-samples/bugfix/exceptions
Browse files Browse the repository at this point in the history
Bugfix: exceptions
  • Loading branch information
megareez authored Jan 11, 2022
2 parents 7d96d31 + 631b6df commit 4b99ee8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cid/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

__version__ = '0.1.7'
__version__ = '0.1.8'
4 changes: 3 additions & 1 deletion cid/helpers/account_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@ def create_account_mapping_sql(self, name) -> str:
template = Template(template_str)
accounts_sql = list()
for account in self.accounts:
acc = account.copy()
account_name = acc.pop('account_name').replace("'", "''")
accounts_sql.append(
"ROW ('{account_id}', '{account_name}:{account_id}', '{parent_account_id}', '{account_status}', '{account_email}')".format(**account))
"""ROW ('{account_id}', '{account_name}:{account_id}', '{parent_account_id}', '{account_status}', '{account_email}')""".format(account_name=account_name, **acc))

# Fill in TPLs
columns_tpl = dict()
Expand Down
5 changes: 2 additions & 3 deletions cid/helpers/quicksight.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ def list_data_sources(self) -> list:
else:
return result.get('DataSources')
except self.client.exceptions.AccessDeniedException:
raise
logger.info('Access denied listing data sources')
return list()
except:
return list()

Expand Down Expand Up @@ -489,10 +490,8 @@ def describe_dataset(self, id) -> dict:
self._datasets.update({_dataset.get('DataSetId'): _dataset})
except self.client.exceptions.ResourceNotFoundException:
logger.info(f'DataSetId {id} do not exist')
raise
except self.client.exceptions.AccessDeniedException:
logger.debug(f'No quicksight:DescribeDataSet permission or missing DataSetId {id}')
raise
return self._datasets.get(id)

def describe_data_source(self, id):
Expand Down

0 comments on commit 4b99ee8

Please sign in to comment.