Commit Graph

44689 Commits

Author SHA1 Message Date
Thomas Jackson
f25505f0dd Make non-async runner executions happen in a thread instead of a daemonized process.
This means we are backwards compatible with builtin print (yay!) and that you can control-c out of the execution (since it will kill the thread too).

Conflicts:

	salt/client/mixins.py
2015-01-28 18:43:44 -08:00
Thomas Jackson
12de6b5dfb Add missing import 2015-01-28 18:43:44 -08:00
Thomas Jackson
8b4f4346e9 Fix typo
Conflicts:

	salt/utils/event.py
2015-01-28 18:43:44 -08:00
Thomas Jackson
7c537cd9ec Workaround for race condition in SaltEvent() creation and the zmq socket actually connecting
Conflicts:

	salt/utils/event.py
2015-01-28 18:43:44 -08:00
Thomas Jackson
7b1bef8cb7 Cleanup, we don't always need an "event" object, so lets not always create one 2015-01-28 18:43:44 -08:00
Thomas Jackson
2cd42e3cad For some reason having the event init in the shared subclass causes problems. 2015-01-28 18:43:44 -08:00
Thomas Jackson
ca826c2c30 Revert function calls
Apparently the wheel API varies quite a bit from the runner API, we'll have to clean that up in the future
2015-01-28 18:43:43 -08:00
Thomas Jackson
3e7caa3fa7 Don't spin waiting for runner return, just use get_event (it has a poller)
Conflicts:
	salt/runner.py
2015-01-28 18:43:43 -08:00
Thomas Jackson
c2c396a48e Add a blacklist of suffixes for the client mixin to print out 2015-01-28 18:43:43 -08:00
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