Merge pull request #26627 from thatch45/state_redirect

Allow inline inject_globals to be... injected
This commit is contained in:
Colton Myers 2015-08-25 15:18:04 -06:00
commit 5f515c3295

View File

@ -607,6 +607,7 @@ class State(object):
self.__run_num = 0
self.jid = jid
self.instance_id = str(id(self))
self.inject_globals = {}
def _gather_pillar(self):
'''
@ -731,6 +732,12 @@ class State(object):
return ret
return ret
def reset_run_num(self):
'''
Rest the run_num value to 0
'''
self.__run_num = 0
def load_modules(self, data=None):
'''
Load the modules into the state
@ -1551,6 +1558,9 @@ class State(object):
'__lowstate__': immutabletypes.freeze(chunks) if chunks else {}
}
if self.inject_globals:
inject_globals.update(self.inject_globals)
if low.get('__prereq__'):
test = sys.modules[self.states[cdata['full']].__module__].__opts__['test']
sys.modules[self.states[cdata['full']].__module__].__opts__['test'] = True