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

states/file.prepend: fixes #32915 define file header verbatim, in inp… #33270

Merged
merged 2 commits into from
May 19, 2016

Conversation

martin-paulus
Copy link
Contributor

What does this PR do?

It adds a new boolean to states/file.py def prepend which makes the outcome of this state arguably more intuitive.

What issues does this PR fix or reference?

This address #32915

Previous Behavior

The user could define text to be prepended to a file, but lines which already occurred elsewhere in the file were not prepended. This led to predictable, but unexpected results.

New Behavior

The user is able to use a new kwarg boolean to state that (s)he wants to have the input appear exactly as entered, at the very top of the target file.

Tests written?

No. But developed through manual test runs.

@@ -3945,7 +3945,8 @@ def prepend(name,
sources=None,
source_hashes=None,
defaults=None,
context=None):
context=None,
header=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to add documentation to the docstring of this function to explain what this does, please.

@cachedout cachedout merged commit b8aa008 into saltstack:develop May 19, 2016
gitebra pushed a commit to gitebra/salt that referenced this pull request May 20, 2016
* upstream/develop:
  revved latest to 2015.8.9, added note regarding Mint Linux to 2015.8.9 release notes
  Event assert (saltstack#33262)
  Catch exception raised from invalid verify_options (saltstack#33317)
  states/file.prepend: fixes saltstack#32915 define file header verbatim, in inp… (saltstack#33270)
  Add support for kapacitor 0.13 (saltstack#33352)
  verify_socket: show what interface:port is in error; DRY refactoring (saltstack#33320)
  Eliminate dry-run false positives for files in /tmp (saltstack#33344)
  refs#33348: fix ret status code for state.sls_id (saltstack#33349)
  adding the () to make changes work (saltstack#33337)
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.

2 participants