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

[2018.3] Fixes to file.grep #48830

Merged
merged 2 commits into from Jul 31, 2018

Conversation

Projects
None yet
3 participants
@garethgreenaway
Member

garethgreenaway commented Jul 30, 2018

What does this PR do?

Fixing a bug that prevents specifying wildcards for filenames.

What issues does this PR fix or reference?

#48659

Previous Behavior

When including a wildcard in the path for file.grep, the path is not being expanded because python_shell is set to False.

New Behavior

Updating file.grep to use glob.glob on the path to gather a list of potential files, then pass that list along to cmd.run_all. If the glob results in an empty list then pass along the original path string to report the error properly.

Tests written?

Yes

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@garethgreenaway garethgreenaway requested a review from terminalmage Jul 30, 2018

@rallytime

This comment has been minimized.

Contributor

rallytime commented Jul 31, 2018

garethgreenaway added some commits Jul 30, 2018

@garethgreenaway garethgreenaway force-pushed the garethgreenaway:48659_file_grep_glob_fix branch from bea7166 to 0791b0a Jul 31, 2018

@rallytime rallytime merged commit e23ba01 into saltstack:2018.3 Jul 31, 2018

6 of 8 checks passed

jenkins/pr/py2-centos-7 The py2-centos-7 job has failed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has failed
Details
WIP ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment