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

Fix #38558 - pillar.get with default= ...,merge=true influence subsequent calls of pillar.get #38579

Merged
merged 4 commits into from
Jan 6, 2017

Conversation

zwo-bot
Copy link
Contributor

@zwo-bot zwo-bot commented Jan 5, 2017

What does this PR do?

Fixes the unexpected behavior when calling pillar.get with merge=true described in #38558 by creating a copy of given default before calling salt.utils.dictupdate.update(default, ..)

What issues does this PR fix or reference?

#38558

Previous Behavior

If a pillar.get with a default and merge=true was called, subsequent calls of pillar.get will be return wrong results (depending on the previous merge)

Tests written?

No

@cachedout cachedout requested a review from terminalmage January 5, 2017 18:10
@cachedout
Copy link
Contributor

@terminalmage I believe you've been involved in this area recently?

Copy link
Contributor

@terminalmage terminalmage left a comment

Choose a reason for hiding this comment

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

This looks good. I can see another unrelated issue, but I'll open a separate PR to take care of it.

@terminalmage terminalmage added the bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch label Jan 5, 2017
@terminalmage
Copy link
Contributor

@rallytime This needs a backport to 2016.3.

@terminalmage
Copy link
Contributor

#38601 fixes the unrelated issue I mentioned above, where using merge=True with a non-dict default would cause an error.

@multani
Copy link
Contributor

multani commented Jan 5, 2017

I added some more commits containing unit tests for this bug in https://github.com/multani/salt.git , branch fix-issue-#38558:

That would be cool if the could be merged as part of this PR as well.

@terminalmage
Copy link
Contributor

@multani You should be able to submit a pull request against @zwo-bot's fork.

@multani
Copy link
Contributor

multani commented Jan 5, 2017

@terminalmage Oh yes, right, I didn't thought about that! It's done now!

@zwo-bot
Copy link
Contributor Author

zwo-bot commented Jan 5, 2017

@multani Thx for writing the tests. You are right about the position of the deepcopy.

@cachedout
Copy link
Contributor

Very nice! When the tests finish, I will get this in.

@rallytime rallytime merged commit 9fadb13 into saltstack:develop Jan 6, 2017
@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 Jan 6, 2017
cachedout pushed a commit that referenced this pull request Jan 6, 2017
@frleb
Copy link

frleb commented Jan 19, 2017

When will you update packages in your apt repository ? What does it trigger the update for the os packages ?

I tried to compare the default_settings and formula_settings, and the default_settings got identical values to the formula_settings.

{% set formula_settings = salt['pillar.get'](
'formula',
default=default_settings.formula,
merge=True
)
%}

I tried your master branch, and it fixes the problem.

Thanks.

FL

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.

6 participants