Skip to content

Fire events for orchestration jobs containing the passed arguments - #35049

Merged
cachedout merged 10 commits into
saltstack:developfrom
terminalmage:zd868
Aug 1, 2016
Merged

cachedout merged 10 commits into
saltstack:developfrom
terminalmage:zd868

Conversation

@terminalmage

@terminalmage terminalmage commented Jul 29, 2016 •

Copy link
Copy Markdown
Contributor

This pull request fires additional events for orchestration jobs, containing the arguments passed to the master. These events are not written to the job cache, but exist to enable code which integrates with Salt orchestration to gather additional information orchestration jobs.

Examples of these events for state, function, runner, and wheel jobs can be found below:

Tag: salt/run/20160728234601815588/args
Data:
{'_stamp': '2016-07-29T04:46:02.193249',
 'args': {'arg': ['vim'],
          'expect_minions': False,
          'expr_form': 'glob',
          'kwarg': {'concurrent': False, 'queue': False, 'saltenv': 'base'},
          'ret': '',
          'ssh': False,
          'timeout': None},
 'name': 'test_orchestration',
 'tgt': '*',
 'type': 'state'}
Event fired at Thu Jul 28 23:46:02 2016
*************************
Tag: salt/run/20160728234601815588/args
Data:
{'_stamp': '2016-07-29T04:46:17.483529',
 'args': {'_cmd_meta': True,
          'arg': [],
          'expect_minions': False,
          'expr_form': 'glob',
          'kwarg': {},
          'ret': '',
          'ssh': False,
          'timeout': None},
 'name': 'test.ping',
 'tgt': '*',
 'type': 'function'}
Event fired at Thu Jul 28 23:46:17 2016
*************************
Tag: salt/run/20160728234601815588/args
Data:
{'_stamp': '2016-07-29T04:46:32.848279',
 'args': {'saltenv': 'dev'},
 'name': 'fileserver.file_list',
 'type': 'runner'}
Event fired at Thu Jul 28 23:46:32 2016
*************************
Tag: salt/run/20160728234601815588/args
Data:
{'_stamp': '2016-07-29T04:46:33.003725',
 'args': {},
 'name': 'config.values',
 'type': 'wheel'}
Event fired at Thu Jul 28 23:46:33 2016

Additionally, this pull request fixes a bug in Salt's orchestration which affects runner/wheel functions which accept an argument named saltenv (for example, fileserver.file_list). This argument was being stripped by salt.utils.format_call(), as we use this CLI argument in state/function calls to set the __env__ value for the Salt run. This does not apply to runner/wheel functions, however.

@cachedout

Copy link
Copy Markdown
Contributor

Some related test failures in unit.modules.state_test.StateTestCase

@cachedout cachedout added the pending-discussion The issue or pull request needs more discussion before it can be closed or merged label Jul 29, 2016
@terminalmage

Copy link
Copy Markdown
Contributor Author

OK I fixed the failing unit tests and rebased against develop to hopefully clear up some of the unrelated failures from the develop branch.

@cachedout
cachedout merged commit 3c58b02 into saltstack:develop Aug 1, 2016
@terminalmage
terminalmage deleted the zd868 branch August 11, 2016 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-discussion The issue or pull request needs more discussion before it can be closed or merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants