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

Allow states to define order: first #24744

Closed
anlutro opened this issue Jun 17, 2015 · 4 comments
Closed

Allow states to define order: first #24744

anlutro opened this issue Jun 17, 2015 · 4 comments
Labels
Core relates to code central or existential to Salt Feature new functionality including changes to functionality and code refactors, etc. P2 Priority 2
Milestone

Comments

@anlutro
Copy link
Contributor

anlutro commented Jun 17, 2015

It seems inconsistent to allow states to define order: last but not order: first. I assumed this functionality was present and was surprised to see my state ordered last instead of first.

At the very least I think salt should throw an exception if the order argument is invalid (i.e. not an int and not the string "last").

@justinta justinta added Feature new functionality including changes to functionality and code refactors, etc. Core relates to code central or existential to Salt labels Jun 18, 2015
@justinta justinta added this to the Approved milestone Jun 18, 2015
@justinta
Copy link

@anlutro I feel like that should be the case. Thanks!

@gtmanfred
Copy link
Contributor

you can set

order: 1

For last, it makes sense, cause what salt does is it goes through and looks for anything that has an order: set, and puts those in order... then it takes all other states and orders them with requisites, and then adds 10000 to the last defined order number, and then starts numbering the rest of the states from that. So, you could either do -1... which I don't think it does, or last which is what was decided on.

@anlutro
Copy link
Contributor Author

anlutro commented Aug 15, 2015

I think last and first make just as much sense. I currently put order: 0 on the states I want to run first, but if I or someone else were to add a state with order: -1 it obviously wouldn't be first anymore.

Salt could easily do the same thing as it does with order: last, but instead of finding the highest number and adding N, it could find the lowest and subtract N.

@junovitch
Copy link
Contributor

Hi. I was quite surprised when I ran into this bug when first in my states didn't go first and in fact when after everything without an order. I opened #34769 with a fix.

cachedout pushed a commit that referenced this issue Jul 20, 2016
salt/state.py: set `chunk['order'] = 0' with `order: first'; fixes #24744
gitebra pushed a commit to gitebra/salt that referenced this issue Jul 21, 2016
* upstream/develop: (32 commits)
  Update 2016.3.2 release notes (saltstack#34850)
  Skip GCE unit tests - causes test suite to hang
  Update release notes for 2016.3.2 (saltstack#34848)
  Fix comment in master config, prevents the service from starting
  Fix Salt failure after merge of saltstack#34683
  drop parsing of vdevs, error passthrough from zpool cli
  eliminate hardcoded vdev type from zpool state
  update the state wrapper to include show_low_sls
  salt.states.zpool - work with updates exec module
  salt.module.zpool - fix bug with properties on/off being parsed as true/false
  Check if a valid value is passed to unlyif/unless
  Fix saltstack#34345
  salt.modules.zpool - drop vdev types to make it more future proof, fallback to zpool cli error messages
  keep this beacon from stack tracing at the loader (saltstack#34825)
  Skip mysql state test if mysqladmin is not available
  Lintfix PEP8: E262
  salt/state.py: set `chunk['order'] = 0' with `order: first'; fixes saltstack#24744
  Lint
  Document master setting
  Set up dynamic config
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core relates to code central or existential to Salt Feature new functionality including changes to functionality and code refactors, etc. P2 Priority 2
Projects
None yet
Development

No branches or pull requests

5 participants