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

Add file.tidied similar to Puppet's tidy resource. #47718

Merged
merged 4 commits into from
Aug 5, 2018
Merged

Add file.tidied similar to Puppet's tidy resource. #47718

merged 4 commits into from
Aug 5, 2018

Conversation

dhs-rec
Copy link
Contributor

@dhs-rec dhs-rec commented May 18, 2018

What does this PR do?

Adds file.tidied as inspired by Puppet

What issues does this PR fix or reference?

Implements #46752

Tests written?

No

Commits signed with GPG?

No

@cachedout
Copy link
Contributor

I left some comments in #46752 on this.

# Helper to match a given name against one or more glob patterns
def _matches(name, patterns=[]):
for pattern in patterns:
if fnmatch.fnmatch(name, pattern):
Copy link
Contributor

Choose a reason for hiding this comment

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

I would use regex instead of fnmatch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@rallytime
Copy link
Contributor

@dhs-rec Can you write some tests for this new function?

@rallytime rallytime added the Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases label May 22, 2018
@dhs-rec
Copy link
Contributor Author

dhs-rec commented May 24, 2018

Once I manage to wrap my mind around the test stuff...

@rallytime
Copy link
Contributor

@dhs-rec Awesome! Thank you!

There's some docs on testing here, if it helps.

@rallytime
Copy link
Contributor

Hi @dhs-rec - just a bump on this one. Were you able to write some tests for this?

@dhs-rec
Copy link
Contributor Author

dhs-rec commented Jul 9, 2018

No, sorry. Tried last week but I somehow didn't get it (I'm not that experienced in Python hacking). So I would be glad if someone else could jump in...

@rallytime
Copy link
Contributor

@gtmanfred Do you think you could help out with some tests on this?

@gtmanfred
Copy link
Contributor

Yeah, make an issue and i will work on them 👍

@gtmanfred
Copy link
Contributor

@dhs-rec i have opened a PR on your branch, once you merge it we should be able to get this PR in.

https://github.com/dhs-rec/salt/pull/1

Thanks,
Daniel

@rallytime rallytime added ZRELEASED - Fluorine reitred label and removed Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases labels Aug 3, 2018
@rallytime rallytime merged commit a2a5876 into saltstack:develop Aug 5, 2018
@dhs-rec
Copy link
Contributor Author

dhs-rec commented Aug 10, 2018

@gtmanfred: Great, thanks a lot!

@dhs-rec dhs-rec deleted the add_file_tidied branch August 10, 2018 09:58
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

4 participants