Allow for the state object to inject new objects into the loader

This commit is contained in:
Thomas S Hatch 2015-08-24 22:55:29 -06:00
parent 226ef73863
commit 3e77b20b80

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):
'''
@ -1551,6 +1552,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