Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS X support for gitlab:check rake tasks #2890

Merged
merged 1 commit into from Feb 14, 2013
Merged

OS X support for gitlab:check rake tasks #2890

merged 1 commit into from Feb 14, 2013

Conversation

cameronyule
Copy link
Contributor

The gitlab:check (and other :check) rake tasks currently fail on OS X due to the gid_for method in TaskHelpers.rake manually parsing the /etc/group file:

$ bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...

gitlab user is in gitg group? ... yes
Has no "-e" in ~git/.profile ... yes
Git configured for gitlab user? ... yes
Has python2? ... yes
python2 is supported version? ... yes

Checking Environment ... Finished

Checking Gitolite ...

Using recommended version ... yes
Repo umask is 0007 in .gitolite.rc? ... yes
Allow all Git config keys in .gitolite.rc ... yes
Config directory exists? ... yes
Config directory owned by git:gitg ... rake aborted!
undefined method `split' for nil:NilClass
/Users/gitlab/gitlab/lib/tasks/gitlab/task_helpers.rake:81:in `gid_for'
/Users/gitlab/gitlab/lib/tasks/gitlab/check.rake:533:in `check_dot_gitolite_user_and_group'
/Users/gitlab/gitlab/lib/tasks/gitlab/check.rake:400:in `block (3 levels) in <top (required)>'
Tasks: TOP => gitlab:check => gitlab:gitolite:check
(See full trace by running task with --trace)

While the /etc/group file exists on OS X it's only used for system services, with all user-created users and groups using Directory Services instead.

This simple pull request replaces the manual parsing of /etc/group with an equivalent call to the platform-independent Etc class from the standard library.

All tests continue to pass after this amend.

…nt call from the Etc class in the Ruby standard library. This has the benefit of supporting additional platforms (e.g. OS X).
@jamesmoss
Copy link

This is incredibly annoying if you're managing an OS X install. The fix in this PR works a treat.

@ghost ghost assigned riyad Feb 14, 2013
riyad added a commit that referenced this pull request Feb 14, 2013
OS X support for gitlab:check rake tasks
@riyad riyad merged commit 428af5e into gitlabhq:master Feb 14, 2013
@riyad
Copy link
Contributor

riyad commented Feb 14, 2013

Thanks ... I didn't know there was something like that in the standard library. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants