Skip to content

Allow to refresh pillar synchronously - #50168

Merged
cachedout merged 19 commits into
developfrom
unknown repository
Nov 29, 2018
Merged

cachedout merged 19 commits into
developfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Oct 23, 2018

Copy link
Copy Markdown

What does this PR do?

This PR adds the optional ability to run saltutil.refresh_pillar Allow to refresh pillar synchronously, saying saltutil.refresh_pillar async=False. I tried to follow the explanatory comment from @gtmanfred and I believe that this works, still I am not sure about the mentioned use of the _gather_pillar() method. I am happy to rework the PR if something is missing.

What issues does this PR fix or reference?

This PR relates to issue #50105

Previous Behavior

It was not possible to know when pillar got really refreshed and the minion is updated properly.

New Behavior

The user can ensure that pillar information is in a refreshed state.

Tests written?

Yes

Commits signed with GPG?

Yes

Alexander Fischer and others added 2 commits October 23, 2018 09:15
@ghost
ghost self-requested a review as a code owner October 23, 2018 12:20
@ghost
ghost self-requested a review October 23, 2018 12:20

@gtmanfred gtmanfred left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks great, thanks!

Comment thread salt/modules/saltutil.py Resolved
Comment thread salt/minion.py Resolved
@cachedout

Copy link
Copy Markdown
Contributor

I get where you're going with this but I can't help but wonder if we should just generalize the pattern of "blocking" on a return event somewhere that we can re-use more easily. It seems like this is something that could be used in other places.

Thoughts?

Alexander Fischer and others added 3 commits October 23, 2018 16:44
@ghost

ghost commented Oct 23, 2018

Copy link
Copy Markdown
Author

Yeah, what we basically want is to be sure that minions work with the pillar, grain, state etc. information we expect them to work this, while dealing with an higher amount of saltenvs (using gitfs) which may change quickly. Still, this should be not part of this PR, as it sounds like a lot of planning and requires some deep knowledge of the code base, which I don't have :)

@Oloremo

Oloremo commented Nov 4, 2018

Copy link
Copy Markdown
Contributor

I'm looking for a way to programmatically check if the pillar data is up to date and could be rendered. I wonder if this PR is what I'm looking for, but based on the change I can't tell if the exit code of synchronously updated pillars will be non-zero in case of an error.

Could you please clarify this?

@ghost

ghost commented Nov 5, 2018

Copy link
Copy Markdown
Author

To my understanding the saltutil.refresh_pillar method only guarantees to return False in case of an issue. The return value in case of no issue is not defined. (This does not change with the PR).

Comment thread salt/defaults/events.py Resolved

@isbm isbm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@afischer-opentext-com OK, done. 👍

@ghost

ghost commented Nov 13, 2018

Copy link
Copy Markdown
Author

This may be not the smartest question, but what is the next step here, is there something I need to do?

Comment thread salt/minion.py Resolved
@cachedout
cachedout merged commit 53386d2 into saltstack:develop Nov 29, 2018
DmitryKuzmenko added a commit to DSRCorporation/salt that referenced this pull request May 10, 2020
Allow to refresh pillar synchronously
This PR adds the optional ability to run saltutil.refresh_pillar Allow
to refresh pillar synchronously, saying saltutil.refresh_pillar
async=False. I tried to follow the explanatory comment from @gtmanfred
and I believe that this works, still I am not sure about the mentioned
use of the _gather_pillar() method. I am happy to rework the PR if
something is missing.

[DKuzmenko] I've slightly reworked it to resolve conflicts with
functionality added to master by DWoz in saltstack#54942.

Co-authored-by: Dmitry Kuzmenko <[email protected]>
dwoz added a commit that referenced this pull request May 12, 2020
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.

7 participants