Skip to content

Commit

Permalink
Update data before scheduling a repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis McPeak committed Mar 19, 2018
1 parent 92027d8 commit c97cca7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions repokid/cli/repokid_cli.py
Expand Up @@ -1029,6 +1029,8 @@ def main():
return repo_all_roles(account_number, dynamo_table, config, hooks, commit=commit, scheduled=False)

if args.get('schedule_repo'):
LOGGER.info('Updating role data')
update_role_cache(account_number, dynamo_table, config, hooks)
return schedule_repo(account_number, dynamo_table, config, hooks)

if args.get('show_scheduled_roles'):
Expand Down
4 changes: 2 additions & 2 deletions repokid/utils/roledata.py
Expand Up @@ -380,13 +380,13 @@ def _get_repoable_permissions(account_number, role_name, permissions, aa_data, n

for permission_name, permission_decision in potentially_repoable_permissions.items():
if permission_name.split(':')[0] in IAM_ACCESS_ADVISOR_UNSUPPORTED_SERVICES:
LOGGER.warn('skipping {}'.format(permission))
LOGGER.warn('skipping {}'.format(permission_name))
continue

# we have an unused service but need to make sure it's repoable
if permission_name.split(':')[0] not in used_services:
if permission_name in IAM_ACCESS_ADVISOR_UNSUPPORTED_ACTIONS:
LOGGER.warn('skipping {}'.format(permission))
LOGGER.warn('skipping {}'.format(permission_name))
continue

permission_decision.repoable = True
Expand Down

0 comments on commit c97cca7

Please sign in to comment.