Commit Graph

44550 Commits

Author SHA1 Message Date
Thomas Jackson
169e3df26e Fix typo 2015-01-10 16:31:59 -08:00
Thomas Jackson
d352057f11 Pylint fix 2015-01-10 16:31:59 -08:00
Thomas Jackson
1e1107272a Remove __progress__ from lint checks, and add in jid_event 2015-01-10 16:31:59 -08:00
Thomas Jackson
a2fcfc2dd7 Change to new event fire_event markup 2015-01-10 16:31:59 -08:00
Thomas Jackson
c2c1457bcc 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-10 16:31:59 -08:00
Thomas Jackson
6cd18c3641 Add __init__ arg to Runner(), and call self.async (since its a subclass) 2015-01-10 16:31:59 -08:00
Thomas Jackson
33d6413e99 Cleanup __init__, since outputters are only needed in run() 2015-01-10 16:31:59 -08:00
Thomas Jackson
10607935ad Fix builtin access 2015-01-10 16:31:59 -08:00
Thomas Jackson
2e0322483a Pylint cleanup 2015-01-10 16:31:59 -08:00
Thomas Jackson
94b720a3d2 Remove local testing file 2015-01-10 16:31:59 -08:00
Thomas Jackson
73537dd34a Remove some local files that somehow got added 2015-01-10 16:31:58 -08:00
Thomas Jackson
50d95709b0 Pylint 2015-01-10 16:31:58 -08:00
Thomas Jackson
13f4222e70 Switch to module, instead of global (for compatibility) 2015-01-10 16:31:58 -08:00
Thomas Jackson
6df0cd17bd Cleanup docs some 2015-01-10 16:31:58 -08:00
Thomas Jackson
229cb0b09a Add missing import 2015-01-10 16:31:58 -08:00
Thomas Jackson
ff32601aff Consolidate some of the __init__ logic 2015-01-10 16:31:58 -08:00
Thomas Jackson
f6f8a248b4 Consolidate to mixin funcs 2015-01-10 16:31:58 -08:00
Thomas Jackson
2ba4b32b22 Consolidate to mixins funcs 2015-01-10 16:31:58 -08:00
Thomas Jackson
ab6de6246c Consolidate more code between runner and wheel modules 2015-01-10 16:31:32 -08:00
Thomas Jackson
f1bb69478c Make the callers of this function parse their args correctly 2015-01-10 16:31:32 -08:00
Thomas Jackson
a9a9dd5c56 Pass in args/kwargs 2015-01-10 16:31:32 -08:00
Thomas Jackson
b809c09b74 Clean up arg parsing in runner client 2015-01-10 16:31:32 -08:00
Thomas Jackson
b58bf7daac Add sleep to test runner 2015-01-10 16:31:31 -08:00
Thomas Jackson
2251f56692 Clean up arg parsing (a little), since the low that is passed does not have a "kwargs" section 2015-01-10 16:31:31 -08:00
Thomas Jackson
5649b1b59b replace l_fun with self.function[fun], since the local no longer exists 2015-01-10 16:31:31 -08:00
Thomas Jackson
cfa82992a7 - Change event name for print
- include old print in new evented print
- support having the args parsed and *not* parsed in low()
2015-01-10 16:31:31 -08:00
Thomas Jackson
3c28d13136 add doc string 2015-01-10 16:31:31 -08:00
Thomas Jackson
1823f499c0 Add stdout_print test function (to test overriding print func). Also include __jid_event__.fire_event (instead of __progress__) 2015-01-10 16:31:31 -08:00
Thomas Jackson
abb3222aba Inject a "print" function into runners, and clean up (a little) the event printout handling. 2015-01-10 16:31:31 -08:00
Thomas Jackson
520d541e06 Cleanup suffix determination 2015-01-10 16:31:31 -08:00
Thomas Jackson
65ed000ba0 Move get_async_returns to mixin 2015-01-10 16:31:31 -08:00
Thomas Jackson
eaff834cb7 Style cleanup 2015-01-10 16:31:00 -08:00
Thomas Jackson
e2c3c7e7e3 include pid in async log line 2015-01-10 16:31:00 -08:00
Thomas Jackson
33d1a51db9 Pylint cleanup 2015-01-10 16:30:01 -08:00
Thomas Jackson
30c3e57957 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-10 16:30:01 -08:00
Thomas Jackson
1843eb0ba6 Remove RunnerEvent 2015-01-10 16:30:01 -08:00
Thomas Jackson
b8dc9a3d98 Add a convenience wrapper for __progress__ 2015-01-10 16:30:01 -08:00
Thomas Jackson
6e8d25f973 Switch to using utils.jid to generate jid 2015-01-10 16:30:01 -08:00
Thomas Jackson
11c417b79a Inject globals without the sys module 2015-01-10 16:30:01 -08:00
Thomas Jackson
b010bca839 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-10 16:30:01 -08:00
Thomas Jackson
4da4ef4218 Refactor-- now all the event firing is done within low()
This means that *all* runner/wheel executions will have events
2015-01-10 16:30:01 -08:00
Thomas Jackson
bd7312dca4 Add a "namespacedevent" object, this give a convinent wrapper for firing events within a specific namespace 2015-01-10 16:30:00 -08:00
Thomas Jackson
3397922ba0 Move "low" to separate line-- everything else is 2015-01-10 16:30:00 -08:00
Thomas Jackson
f455281fd4 Misc cleanup 2015-01-10 16:30:00 -08:00
Thomas Jackson
89cbd19dce Consolidate the cmd() func to just use low(), since its all redundant (and most of the old arg parsing was redundant) 2015-01-10 16:30:00 -08:00
Thomas Jackson
4ed4acaeb9 Make Async really async-- and always create another process to execute the runner 2015-01-10 16:30:00 -08:00
Thomas Jackson
c17462d062 Caste jid as str (its an int all over), and change runner tag to correct prefix 2015-01-10 16:30:00 -08:00
Thomas Jackson
5e59781ae8 Remove local multiprocessing, and use the aync client mixin 2015-01-10 16:30:00 -08:00
Mike Place
0e935486de Merge pull request #19605 from jacksontj/develop
Fixes for develop
2015-01-10 08:54:59 -07:00
Thomas Jackson
925afac98d Temporarily change this test to work around race condition in the runnerclient
@rallytime If you have some list of tests that are disabled that shouldn't be, this is one for the list :)
2015-01-10 00:18:16 -08:00