Skip to content

Commit

Permalink
improved check
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwittig committed May 15, 2018
1 parent d2c3d53 commit b4de9c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions import_users.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,16 @@ function sync_accounts() {
get_sudoers_groups_from_tag

iam_users=$(get_clean_iam_users | sort | uniq)
sudo_users=$(get_clean_sudoers_users | sort | uniq)
if [[ -z "${iam_users}" ]]
then
log "we just got back an empty iam_users user list which is likely caused by an IAM outage!"
exit 1
fi

if [[ -z "${iam_users}" ]] && [[ -z "${sudo_users}" ]]
sudo_users=$(get_clean_sudoers_users | sort | uniq)
if [[ ! -z "${SUDOERS_GROUPS}" ]] && [[ ! "${SUDOERS_GROUPS}" == "##ALL##" ]] && [[ -z "${sudo_users}" ]]
then
log "we just got back an empty iam_users and sudo_users user list which is likely caused by an IAM outage!"
log "we just got back an empty sudo_users user list which is likely caused by an IAM outage!"
exit 1
fi

Expand Down

0 comments on commit b4de9c4

Please sign in to comment.