Thomas Jackson
8ce214c03f
Pylint and style cleanup
2015-01-28 18:43:43 -08:00
Thomas Jackson
bad5812c38
Re-add call_func backwards compat func
2015-01-28 18:43:43 -08:00
Thomas Jackson
9f0e4a9018
Add a return to the async method (jid)
2015-01-28 18:43:43 -08:00
Thomas Jackson
74886537f3
Fix runner returns
2015-01-28 18:43:43 -08:00
Thomas Jackson
645027c0fe
cleanup "Caste jid as str (its an int all over), and change runner tag to correct prefix"
...
This reverts most of commit 745f2d84835ae23800358cd4dcc9c8525b502714.
apparently I picked up some other changes I didn't mean to
Conflicts:
salt/utils/event.py
tests/integration/utils/test_reactor.py
2015-01-28 18:43:43 -08:00
Thomas Jackson
e172dd221f
Remove PID since the process is daemonized afterwards, meaning that pid isn't correct
2015-01-28 18:43:43 -08:00
Thomas Jackson
178689d107
Clean up comments
2015-01-28 18:43:43 -08:00
Thomas Jackson
14efa520f7
Backwards compatibility with args as well.
...
With format_call you can pass in positional args as kwargs with the key being the name of the variable in the function call.
2015-01-28 18:43:43 -08:00
Thomas Jackson
82521ea205
Add backwards compatibility to "low" function-- since the object isn't well documented we have apparently used it in all possible ways ;)
2015-01-28 18:43:43 -08:00
Thomas Jackson
f835dd587c
Style cleanup
2015-01-28 18:43:43 -08:00
Thomas Jackson
3e531e706e
Fix typo
2015-01-28 18:43:43 -08:00
Thomas Jackson
5bfef71240
Pylint fix
2015-01-28 18:43:43 -08:00
Thomas Jackson
4df4a297cb
Remove __progress__ from lint checks, and add in jid_event
2015-01-28 18:43:43 -08:00
Thomas Jackson
aedfe4ef68
Change to new event fire_event markup
2015-01-28 18:43:43 -08:00
Thomas Jackson
b6a529b292
Change how we print out events from runner/wheel calls
...
Now if you do something like:
```
fire_event({'data': 'Runner is {0}% done'.format(i), 'outputter': 'pprint'}, 'progress')
'Runner is 96% done'
```
```
fire_event({'data': 'Runner is {0}% done'.format(i)}, 'progress')
progress: {'data': 'Runner is 12% done'}
```
This means that you don't have to actually specify the outputters etc if you just want it to print something.
2015-01-28 18:43:43 -08:00
Thomas Jackson
6939e39d54
Add __init__ arg to Runner(), and call self.async (since its a subclass)
2015-01-28 18:43:43 -08:00
Thomas Jackson
71c9533185
Cleanup __init__, since outputters are only needed in run()
2015-01-28 18:43:43 -08:00
Thomas Jackson
123287549b
Fix builtin access
2015-01-28 18:43:43 -08:00
Thomas Jackson
b67a048853
Pylint cleanup
2015-01-28 18:43:43 -08:00
Thomas Jackson
a70b3906cc
Remove local testing file
2015-01-28 18:43:43 -08:00
Thomas Jackson
7ca4cccf56
Remove some local files that somehow got added
2015-01-28 18:43:43 -08:00
Thomas Jackson
b820901688
Pylint
2015-01-28 18:43:43 -08:00
Thomas Jackson
76b0ee2576
Switch to module, instead of global (for compatibility)
2015-01-28 18:43:43 -08:00
Thomas Jackson
2141fa855c
Cleanup docs some
2015-01-28 18:43:43 -08:00
Thomas Jackson
005f3b7e08
Add missing import
2015-01-28 18:43:42 -08:00
Thomas Jackson
86eac002dc
Consolidate some of the __init__ logic
2015-01-28 18:43:42 -08:00
Thomas Jackson
be813fe14b
Consolidate to mixin funcs
2015-01-28 18:43:42 -08:00
Thomas Jackson
e14c3f1e8d
Consolidate to mixins funcs
...
Conflicts:
salt/runner.py
2015-01-28 18:43:42 -08:00
Thomas Jackson
f58c5b63a5
Consolidate more code between runner and wheel modules
2015-01-28 18:43:42 -08:00
Thomas Jackson
052a9686ec
Make the callers of this function parse their args correctly
2015-01-28 18:43:42 -08:00
Thomas Jackson
f751429468
Pass in args/kwargs
2015-01-28 18:43:42 -08:00
Thomas Jackson
15c3637828
Clean up arg parsing in runner client
2015-01-28 18:43:42 -08:00
Thomas Jackson
9c983c3cb4
Add sleep to test runner
2015-01-28 18:43:42 -08:00
Thomas Jackson
43b16a87ce
Clean up arg parsing (a little), since the low that is passed does not have a "kwargs" section
2015-01-28 18:43:42 -08:00
Thomas Jackson
4f16129375
replace l_fun with self.function[fun], since the local no longer exists
2015-01-28 18:43:42 -08:00
Thomas Jackson
9ea2a275f1
- Change event name for print
...
- include old print in new evented print
- support having the args parsed and *not* parsed in low()
Conflicts:
salt/client/mixins.py
2015-01-28 18:43:42 -08:00
Thomas Jackson
b87f700456
add doc string
2015-01-28 18:43:42 -08:00
Thomas Jackson
8720f61061
Add stdout_print test function (to test overriding print func). Also include __jid_event__.fire_event (instead of __progress__)
2015-01-28 18:43:42 -08:00
Thomas Jackson
6f3f7850c8
Move get_async_returns to mixin
2015-01-28 18:43:42 -08:00
Thomas Jackson
79e5ad40ba
Style cleanup
2015-01-28 18:43:41 -08:00
Thomas Jackson
8befb64bb1
include pid in async log line
2015-01-28 18:43:41 -08:00
Thomas Jackson
57b3a49534
Pylint cleanup
2015-01-28 18:43:41 -08:00
Thomas Jackson
2241444f88
Fix for #18256
...
With this new setup of everything firing events, this seemed like a good time to tackle this infinite recursion from the reactor. What this does is pass a "user" (Reactor) to all jobs that the reactor starts. Then the reactor skips all events created by that username-- thereby only reacting to events not caused by itself.
2015-01-28 18:43:41 -08:00
Thomas Jackson
e6c0d0f48e
Remove RunnerEvent
2015-01-28 18:43:41 -08:00
Thomas Jackson
1fb880f4fa
Add a convenience wrapper for __progress__
2015-01-28 18:43:41 -08:00
Thomas Jackson
f5b2b36036
Switch to using utils.jid to generate jid
2015-01-28 18:43:41 -08:00
Thomas Jackson
4d576eacc0
Inject globals without the sys module
2015-01-28 18:43:41 -08:00
Thomas Jackson
d2522a8260
Swallow exceptions on __del__ of event
...
This will avoid exception in interpreter shutdown such as:
```
Exception TypeError: 'an integer is required' in <bound method MasterEvent.__del__ of <salt.utils.event.MasterEvent object at 0x3ab2a50>> ignored
```
Most of which are because during interpreter shutdown there is no order gaurantee so things (such as the zmq lib) get unloaded even though the __del__ method has references to it
2015-01-28 18:43:41 -08:00
Thomas Jackson
719e71e3da
Refactor-- now all the event firing is done within low()
...
This means that *all* runner/wheel executions will have events
2015-01-28 18:43:41 -08:00
Thomas Jackson
7f8ae33da2
Add a "namespacedevent" object, this give a convinent wrapper for firing events within a specific namespace
2015-01-28 18:43:41 -08:00