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

couldn't find HOME environment -- expanding `~' #73

Open
sfiggins opened this issue Jun 20, 2013 · 1 comment
Open

couldn't find HOME environment -- expanding `~' #73

sfiggins opened this issue Jun 20, 2013 · 1 comment
Milestone

Comments

@sfiggins
Copy link

I'm using nexus_cli with the RiotGames Nexus cookbook. When I run a chef-client run manually it completes without errors, but when it's run from the daemonized chef-client (on a rhel 6 system), the run fails when trying to retrieve the config because it has no $HOME set.

This happens looking up the DEFAULT config file at "~/.nexus_cli"

Would it be a good to have a fall back if there is no $HOME set?

Generated at 2013-06-20 13:52:02 -0500
ArgumentError: nexus_user[admin](nexus::default line 184) had an error: ArgumentError: couldn't find HOME environment -- expanding ~' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nexus_cli-3.0.0/lib/nexus_cli/configuration.rb:14:inexpand_path'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nexus_cli-3.0.0/lib/nexus_cli/configuration.rb:14:in path' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nexus_cli-3.0.0/lib/nexus_cli/configuration.rb:21:inparse'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nexus_cli-3.0.0/lib/nexus_cli/remote_factory.rb:11:in `create'

@KAllan357
Copy link
Contributor

Thanks for the report @sfiggins. The nexus-cookbook uses this gem in its LWRPs, and the actual bug is that the Configuration class attempts to load the file, even though when we are using it as an API, we are creating an instance with config from attributes or a data bag.

While I'm not sure why your user would lose its $HOME, I think there might be some sort of fall back or a better error message.

In summary, I think there are two take-aways here:

  • Configuration should not attempt to load a file when you are passing through your options. You can see some major changes I've been working on in this branch - https://github.com/RiotGames/nexus_cli/tree/refactor_api_big_time
  • If $HOME is unavailable, we either need a platform agnostic place to look or a slightly better error message.

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

No branches or pull requests

2 participants