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 "none" as a pillar merging strategy #36435

Merged
merged 9 commits into from
Sep 23, 2016
Merged

Add "none" as a pillar merging strategy #36435

merged 9 commits into from
Sep 23, 2016

Conversation

yhekma
Copy link

@yhekma yhekma commented Sep 20, 2016

What does this PR do?

Add "none" option to the pillar merging strategy to prevent merging of pillar data altogether, which is referenced in #29421

What issues does this PR fix or reference?

#29421

New Behavior

When pillar_source_merging_strategy is set to "none", no pillar merging is done and only the pillar data of the environment that is called is used

Tests written?

No

Please review Salt's Contributing Guide for best practices.

@cachedout
Copy link
Contributor

@yhekma Thanks very much! This code does look fairly safe although the test suite doesn't seem to like it. Would you mind investigating?

@yhekma
Copy link
Author

yhekma commented Sep 20, 2016

@cachedout sure, I'll have a look tomorrow

@cachedout
Copy link
Contributor

@yashlyft Much appreciated. Thank you!

@yhekma
Copy link
Author

yhekma commented Sep 21, 2016

@cachedout is there a way to retrigger the tests? Apart from pushing a new commit I mean?

@cachedout
Copy link
Contributor

Go Go Jenkins!

@cachedout
Copy link
Contributor

@yhekma Done. The phrase above does the trick. :]

@yhekma
Copy link
Author

yhekma commented Sep 21, 2016

@cachedout I cannot figure out why the tests are failing. It looks like it doesn't have anything to do with my code changes. Can you confirm or am I overlooking something?

@yhekma
Copy link
Author

yhekma commented Sep 21, 2016

Go Go Jenkins!

@cachedout
Copy link
Contributor

@yashlyft I think that the remaining test failures are unrelated to your changes. This is likely ready for a full review and then hopefully a merge.

@yhekma
Copy link
Author

yhekma commented Sep 21, 2016

@cachedout Ok, great, let me know when and if I need to do anything.

Ps.
The name is yhekma (yay completion) :)

@cachedout
Copy link
Contributor

@yhekma Guh, sorry about that. Github's autocomplete likes to let me embarrass myself from time to time. ;]

We'll get this in ASAP. I'll take another look at it after the tests finish running.

@@ -7571,9 +7571,14 @@ New in version 2014.7.0.
Default: \fBsmart\fP
.sp
The pillar_source_merging_strategy option allows you to configure merging
strategy between different sources. It accepts 4 values:
strategy between different sources. It accepts 5 values:
Copy link
Contributor

Choose a reason for hiding this comment

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

For future reference, you don't need to edit the man pages. They are automatically rebuilt on each release.

Copy link
Author

Choose a reason for hiding this comment

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

Noted:)

@@ -2791,6 +2791,9 @@ Default: ``smart``
The pillar_source_merging_strategy option allows you to configure merging
strategy between different sources. It accepts 4 values:

* ``none``:
it will not do any merging at all and only parse the pillar data from the passed environment and 'base' if no environment was specified.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please capitalize the first word in this sentence?

if self.opts.get('pillar_source_merging_strategy', None) == "none":
if self.saltenv and saltenv != self.saltenv:
continue
if not self.saltenv and not saltenv == 'base':
Copy link
Contributor

Choose a reason for hiding this comment

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

Typically we'd like to see these conditionals combined but here I think it enhances readability. Good call. 👍

@cachedout cachedout merged commit a149407 into saltstack:develop Sep 23, 2016
@yhekma
Copy link
Author

yhekma commented Sep 23, 2016

@cachedout since I believe this "fixes" #29421 which is flagged as a bug and as high severity, can I expect this to be backported to let's say 2016.3? Right now we (eBay) have created our own patch for our own package, but would like to get back to upstream:)

@cachedout
Copy link
Contributor

Typically it is our policy to only include new features in major releases but given the nature of the issue in #29421 I think it's fair to consider this a bug fix and backport it. I'll mark it as such.

@cachedout cachedout added the bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch label Sep 23, 2016
@yhekma
Copy link
Author

yhekma commented Sep 23, 2016

@cachedout great, thanks!

@rallytime rallytime added ZZZ[Done]-back-ported-bf RETIRED The pull request has been back-ported to an older branch. and removed bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch labels Sep 23, 2016
@rallytime
Copy link
Contributor

@yhekma I have back-ported your fix to the 2016.3 branch in #36532. It will be available in the 2016.3.4 release.

rallytime pushed a commit that referenced this pull request Sep 23, 2016
* Added "none" option for pillar_source_merging_strategy

* added none to merging strategy in dictupdate so we no longer log warnings when it is selected

* Updated documentation

* fix for when pillar_source_merging_strategy is not set

* Fix looking up pillar data when merging is set to "none" and no saltenv was passed

* Fix looking up pillar data when merging is set to "none" and no saltenv was passed retry

* Let's not break when no merging strategy is passed

* Capitalisation

* Update on doc
gitebra pushed a commit to gitebra/salt that referenced this pull request Sep 26, 2016
* upstream/develop: (41 commits)
  Fix typo in postgres_user.py
  Python 3 module reload compatability
  Fix rst table syntax in logging docs section
  Fix lineterminator on kapacitor diffs
  Wait for kill in ProcessManager should be greater in main process than in subprocess.
  Don't set the `daemon` flag for LoggingQueue process.
  archive.extracted: Use `user`/`group`, not `archive_user`
  Mercurial Module: Pass the identity_path portion as own arg
  Fixup the rabbitmq_user state test failure (saltstack#36541)
  Back-port saltstack#36435 to 2016.3 (saltstack#36532)
  Be explicit about the salt.utils.templates import (saltstack#36535)
  Wrap the entire GrainsAppendTestCase class with destructiveTest (saltstack#36537)
  states.archive: use archive.cmd_unzip when possible
  modules.archive.unzip: log a warning about perms
  Per issue 36451, fixed bug where gpg.trust_key calls get_key for the current user, not the input user
  Cache the renderer in the pillar
  Adding openstack heat module execution and state
  Updated tests to reflect changes in salt.utils.vmware.wait_for_pid
  Added tests for get_root_folder
  Added get_root_folder method in salt.utils.vmware
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ZZZ[Done]-back-ported-bf RETIRED The pull request has been back-ported to an older branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants