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 "sync_mods" argument to state.apply/state.sls #48037

Merged
merged 9 commits into from Jun 21, 2018

Conversation

Projects
None yet
3 participants
@terminalmage
Member

terminalmage commented Jun 8, 2018

The docs inaccurately stated that custom module types were synced when state.apply is run, but this is only the case when run without SLS targets (i.e. when a highstate is run). This PR does the following:

  1. Updates the docs

  2. Adds a "sync" argument to provide the functionality that the docs suggested was already present

Resolves #48025.

terminalmage added some commits Jun 8, 2018

Add sync option to state.apply/state.sls
This allows for custom types to be synced before executing states, when
not running a highstate.
Remove redundant mocking
This mocking was added to setup_loader_modules and is no longer needed
in individual tests.
@@ -599,6 +598,22 @@ def apply_(mods=None,
.. code-block:: bash
salt '*' state.apply test localconfig=/path/to/minion.yml
sync

This comment has been minimized.

@cachedout

cachedout Jun 13, 2018

Contributor

Should this be something like sync_mods. The first thing this makes me think of is synchronous but maybe that's just me?

This comment has been minimized.

@rallytime

rallytime Jun 13, 2018

Contributor

I like that idea ^

This comment has been minimized.

@terminalmage

terminalmage Jun 16, 2018

Member

Yes, that does sound better, I will get that changed.

terminalmage added some commits Jun 16, 2018

Change 2018.3.2 to 2018.3.3
A quick bugfix release was added after 2018.3.1, so this code will not
make it in until 2018.3.3.
@terminalmage

This comment has been minimized.

Member

terminalmage commented Jun 16, 2018

sync renamed to sync_mods per recommendation from @cachedout.

Also, I updated the versionadded to bump the version number to 2018.3.3.

@terminalmage terminalmage changed the title from Add "sync" argument to state.apply/state.sls to Add "sync_mods" argument to state.apply/state.sls Jun 16, 2018

@rallytime rallytime requested a review from cachedout Jun 17, 2018

@rallytime

This comment has been minimized.

Contributor

rallytime commented Jun 19, 2018

@terminalmage There is a related test failure with this change:

  • unit.modules.test_state.StateTestCase.test_sls_sync

https://jenkins.saltstack.com/job/PR/job/salt-pr-linode-ubuntu14-n/23710/

Can you take a look?

@terminalmage

This comment has been minimized.

Member

terminalmage commented Jun 21, 2018

This is fixed now, I forgot to update my test to reflect the change of the argument name.

:ref:`highstate <running-highstate>` automatically syncs all custom
module types.
.. versionadded:: 2017.7.7,2018.3.3,Fluorine

This comment has been minimized.

@rallytime

rallytime Jun 21, 2018

Contributor

Ah, i just noticed this since you mentioned updating 2018.3.3 in another comment. The 2017.7.7 should be 2017.7.8

This comment has been minimized.

@terminalmage

@rallytime rallytime merged commit 731ec0a into saltstack:2017.7 Jun 21, 2018

3 of 9 checks passed

default Build started sha1 is merged.
Details
jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #5927 — RUNNING
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #23856 — RUNNING
Details
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #10898 — RUNNING
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #22818 — RUNNING
Details
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #19980 — RUNNING
Details
WIP ready for review
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #26131 — SUCCESS
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #18183 — SUCCESS
Details

@terminalmage terminalmage deleted the terminalmage:fix-custom-types-sync-docs branch Jun 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment