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

salt/state.py: set chunk['order'] = 0' with order: first'; fixes #24744 #34769

Closed
wants to merge 10,000 commits into from

Conversation

junovitch
Copy link
Contributor

What does this PR do?

Fixes behavior of 'order: first' (explain in further detail in the commit message and below)

What issues does this PR fix or reference?

#24744 and the later (closed) #26278

Previous Behavior

Explained in commit message.

New Behavior

First goes first :)

Tests written?

No. Tested manually before removing the debug logging and committing.

Please review Salt's Contributing Guide for best practices.

Commit Message

salt/state.py: set chunk['order'] = 0' withorder: first'; fixes #24744

Currently the `order: first' keyword executes later states without order
options. Consider a test case such as:

sleep 1:
  cmd.run:
    - order: first
sleep 2:
  cmd.run
sleep 3:
  cmd.run
sleep 4:
  cmd.run:
    - order: last

The contents of each chunk dictionary at runtime show that the 'first' state
is not evaluated to 'first'.

{'name': 'sleep 4', 'state': 'cmd', 'id': 'sleep 4', 'fun': 'run', 'env': 'base', 'sls': u'test', 'order': 1010100}
{'name': 'sleep 2', 'state': 'cmd', 'id': 'sleep 2', 'fun': 'run', 'env': 'base', 'sls': u'test', 'order': 10000}
{'name': 'sleep 3', 'state': 'cmd', 'id': 'sleep 3', 'fun': 'run', 'env': 'base', 'sls': u'test', 'order': 10001}
{'name': 'sleep 1', 'state': 'cmd', 'id': 'sleep 1', 'fun': 'run', 'env': 'base', 'sls': u'test', 'order': 10100}

Mike Place and others added 30 commits June 7, 2016 07:37
fix some problems with the gem module integration tests
states.pkg int tests: skip if pkg mgr unavailable
This change did not make it into 2015.5.11, and it is not certain at
this time whether or not we will do a 2015.5.12.
This time win_servermanager
These all assert directly against mock objects. They're pointless.
…t_stacktrace

Fix another unit test stacktrace in pkg_resource
Support syncing pillar modules to masterless minions
Conflicts:
  - salt/modules/saltutil.py
  - salt/states/archive.py
This is done for API compatibility
This is done for API compatibility
This is done for API compatibility
This is done for API compatibility
This is done for API compatibility
This is done for API compatibility
This resolves an edge case in which the "fromrepo" argument is passed to
the pkg.uptodate state. We pass through the kwargs to pkg.upgrade, but
do not pass the same kwargs to list_upgrades, resulting in inconsistent
results.
Mike Place and others added 19 commits July 13, 2016 12:12
Check that mysqladmin exists before running mysql integration tests
* Better error handling for __virtual__ in dockerng module

* Modify lodaer global test to use populated dunders

This prevents a number of errors in the error log and makes for a
more robust test IMHO

* Lint saltstack#34644
Clarifies the proper way to reference states
Revert "Modify lodaer global test to use populated dunders"
…ean-values

Bugfix: Zypper `pkg.list_products` returns False on some empty values (2015.8)
fix second run problems with pkg.installed using sources
Add output_file option to master config docs
 Remove dict.update and always use loop because this is failing for
 NamespacedDictWrapper.
There's a race condition in here somewhere. Disabling and tracking issue elsewhere.
@junovitch
Copy link
Contributor Author

Note: this is against 2014.7 and is a clean forward merge to 2015.5, 2015.8 (where I ran into the issue), 2016.3 (where I tested the fix), and develop. The version in 2014.1 is slightly different and it would have to be manually backported.

daveye and others added 2 commits July 19, 2016 15:41
…up/2015.8

Bugfix: Startup states on minions are not being written to mysql returner
@cachedout
Copy link
Contributor

@junovitch We no longer do merge forwards from 2014.7. Could you please close this and re-open it against 2015.8?

…ltstack#24744

Currently the `order: first' keyword executes later states without order
options. Consider a test case such as:

```SaltStack
sleep 1:
  cmd.run:
    - order: first
sleep 2:
  cmd.run
sleep 3:
  cmd.run
sleep 4:
  cmd.run:
    - order: last
```

The contents of each chunk dictionary at runtime show that the 'first' state
is not evaluated to 'first'.

{'name': 'sleep 4', 'state': 'cmd', '__id__': 'sleep 4', 'fun': 'run', '__env__': 'base', '__sls__': u'test', 'order': 1010100}
{'name': 'sleep 2', 'state': 'cmd', '__id__': 'sleep 2', 'fun': 'run', '__env__': 'base', '__sls__': u'test', 'order': 10000}
{'name': 'sleep 3', 'state': 'cmd', '__id__': 'sleep 3', 'fun': 'run', '__env__': 'base', '__sls__': u'test', 'order': 10001}
{'name': 'sleep 1', 'state': 'cmd', '__id__': 'sleep 1', 'fun': 'run', '__env__': 'base', '__sls__': u'test', 'order': 10100}
@junovitch
Copy link
Contributor Author

Closing per @cachedout. I was following the "create your branch from the oldest release branch that contains the bug" from https://docs.saltstack.com/en/latest/topics/development/contributing.html here. A pull request against 2015.8 is open at #34803

@junovitch junovitch closed this Jul 20, 2016
@junovitch junovitch deleted the issue_24744 branch August 28, 2016 22:05
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.

None yet