Skip to content

BUG: Don't fail if wheel exists#145

Merged
jose-caballero merged 1 commit into
mainfrom
fix_update_cloud_users_sh
May 14, 2026
Merged

BUG: Don't fail if wheel exists#145
jose-caballero merged 1 commit into
mainfrom
fix_update_cloud_users_sh

Conversation

@khalford
Copy link
Copy Markdown
Member

As we have used set -e the script will fail on any error. This is safe and good practice but groupadd wheel normally fails as the group already exists. By adding the or operator || we can bypass the set -e and allow the script to continue.

@khalford khalford self-assigned this May 14, 2026
@khalford khalford added bug Something isn't working OS Images labels May 14, 2026
@jose-caballero
Copy link
Copy Markdown
Contributor

If you don't want to print out messages (one of the UNIX rules is not to printout unless really needed), there is an alternative:

   groupadd wheel > /dev/null || true

or maybe check first if the group exists

  getent group wheel >/dev/null || groupadd wheel

Up to you

@khalford
Copy link
Copy Markdown
Member Author

If you don't want to print out messages (one of the UNIX rules is not to printout unless really needed), there is an alternative:

   groupadd wheel > /dev/null || true

or maybe check first if the group exists

  getent group wheel >/dev/null || groupadd wheel

Up to you

I will do that

As we have used set -e the script will fail on any error. This is safe
and good practice but groupadd wheel normally fails as the group already
exists. By adding the or operator || we can bypass the set -e and allow
the script to continue.
@khalford khalford force-pushed the fix_update_cloud_users_sh branch from 3184e54 to 61db3c9 Compare May 14, 2026 07:52
@jose-caballero jose-caballero merged commit ef6c3b3 into main May 14, 2026
8 checks passed
@jose-caballero jose-caballero deleted the fix_update_cloud_users_sh branch May 14, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working OS Images

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants