Skip to content

Root dir prepend fix gh #2 - #41281

Merged
cachedout merged 7 commits into
saltstack:developfrom
alexbleotu:root_dir_prepend_fix-gh
May 17, 2017
Merged

cachedout merged 7 commits into
saltstack:developfrom
alexbleotu:root_dir_prepend_fix-gh

Conversation

@alexbleotu

Copy link
Copy Markdown
Contributor

What issues does this PR fix or reference?

The PR fixes how the root_dir is prependend to relative paths. Also it fixes how the log_file path is derived when the log_dir override is set in the config file.

Previous Behavior

The previous logic of prepending the root_dir to relative paths doesn't take into consideration if the default root_dir (set in the code in _syspaths.py) is included in the overriden root dir (set in the config file). The logic strips out just a segment of the root_dir (the default root_dir) so the prepend doesn't work correctly.

Also, the default path assigned to the default log_file won't be overriden if the log_dir override is specified in the config file.

New Behavior

The prepend and log_file bugs are fixed. The default log_file path is adjusted if the log_dir override is specified. The logic to prepend the root_dir (either the default one in code or the override in the config) is fixed.

Tests written?

Yes

  • test

added to check that the prepend logic works correctly when the default root_dir is included in the override root_dir.

Please review Salt's Contributing Guide for best practices.

@ghost

ghost commented May 16, 2017

Copy link
Copy Markdown

@alexbleotu, thanks for your PR! By analyzing the history of the files in this pull request, we identified @anlutro, @cro and @s0undt3ch to be potential reviewers.

@alexbleotu

Copy link
Copy Markdown
Contributor Author

second attempt to this

@cachedout

Copy link
Copy Markdown
Contributor

@alexbleotu

Copy link
Copy Markdown
Contributor Author

All tests have been fixed. The pylint error is not due to my changes, I assume it will be fixed by someone else.

@cro

cro commented May 17, 2017

Copy link
Copy Markdown
Contributor

@alexbleotu -- I'm sorry for the trouble, could you rebase against current develop? That should clear up that last lint error (that's a Python 3-ism that crept in and got fixed).

@alexbleotu
alexbleotu force-pushed the root_dir_prepend_fix-gh branch from e95b6fd to 00d0c37 Compare May 17, 2017 16:22
@alexbleotu

Copy link
Copy Markdown
Contributor Author

Sure - rebased. @cro - can you glance over the changes, see if they make sense

@cro

cro commented May 17, 2017

Copy link
Copy Markdown
Contributor

Yes, I'd be glad to.

@cachedout
cachedout requested a review from cro May 17, 2017 18:25
@cachedout
cachedout merged commit 4ed45d9 into saltstack:develop May 17, 2017
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

Successfully merging this pull request may close these issues.

3 participants