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

Die cwd die #10923

Merged
merged 9 commits into from May 4, 2015
Merged

Die cwd die #10923

merged 9 commits into from May 4, 2015

Conversation

rmuir
Copy link
Contributor

@rmuir rmuir commented May 1, 2015

See #10877 for reference.

Currently some code looks in CWD and places like $user.home for configuration files in a confusing way, in some cases even overriding other paths (so if you have a stray elasticsearch.yml there, good luck).

Tests hide the problem because they add too many permissions. We fixed that here and then all tests were failing, and made hacky changes to get tests passing again.

So some of the changes here can be cleaned up / solved differently. For example we could look for the custom hunspell data directory in Environment, grant access to it, and deprecate it instead of throwing an error. But, with what is here all tests pass so I think we know enough to discuss so we can move forward.

public Environment(Settings settings) {
this.settings = settings;
if (settings.get("path.home") != null) {
homeFile = PathUtils.get(cleanPath(settings.get("path.home")));
} else {
homeFile = PathUtils.get(System.getProperty("user.dir"));
throw new IllegalStateException("path.home is not configured");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rmuir
Copy link
Contributor Author

rmuir commented May 4, 2015

if no one has opinions then, I will push in 24 hours.

@s1monw
Copy link
Contributor

s1monw commented May 4, 2015

this looks great - the only thing that I'd like to see is a note in the migration guide that this has been fixed and that for instance the dictionary files should be located in a different place. It's in docs/reference/migration/migrate_2_0.asciidoc

rmuir added 2 commits May 4, 2015 09:55
Conflicts:
	src/test/java/org/elasticsearch/client/AbstractClientHeadersTests.java
@s1monw
Copy link
Contributor

s1monw commented May 4, 2015

LGTM

rmuir added a commit that referenced this pull request May 4, 2015
Remove CWD access in tests and don't implicitly use CWD/user.dir for configuration.
@rmuir rmuir merged commit 02da246 into master May 4, 2015
@s1monw s1monw deleted the die_cwd_die branch May 5, 2015 08:05
@clintongormley clintongormley added >enhancement :Core/Infra/Settings Settings infrastructure and APIs labels Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants