Add stdout_print test function (to test overriding print func). Also include __jid_event__.fire_event (instead of __progress__)

This commit is contained in:
Thomas Jackson 2014-12-31 15:49:50 -08:00
parent 6f3f7850c8
commit 8720f61061

View File

@ -3,6 +3,7 @@
This runner is used only for test purposes and servers no production purpose This runner is used only for test purposes and servers no production purpose
''' '''
from __future__ import absolute_import from __future__ import absolute_import
from __future__ import print_function
# Import python libs # Import python libs
import time import time
import salt.ext.six as six import salt.ext.six as six
@ -36,12 +37,17 @@ def raw_arg(*args, **kwargs):
return ret return ret
def stdout_print():
print ('foo')
return 'bar'
def stream(): def stream():
''' '''
Return True Return True
''' '''
ret = True ret = True
for i in range(1, 100): for i in range(1, 100):
__progress__('Runner is {0}% done'.format(i), outputter='pprint') # __progress__('Runner is {0}% done'.format(i), outputter='pprint')
__jid_event__.fire_event({'data': 'Runner is {0}% done'.format(i), 'outputter': 'pprint'}, 'progress')
time.sleep(0.1) time.sleep(0.1)
return ret return ret