Create regdata before try/except (#34931)

This commit is contained in:
Joseph Hall 2016-07-26 09:05:24 -06:00 committed by Nicole Thomas
parent e1a6ebac3a
commit cdc9882f83

View File

@ -47,12 +47,12 @@ class ThorState(salt.state.HighState):
self.returners = salt.loader.returners(self.opts, {})
self.reg_ret = self.opts.get('register_returner', None)
regdata = {}
if self.reg_ret is not None:
try:
regdata = self.returners['{0}.load_reg'.format(self.reg_ret)]()
except Exception as exc:
log.error(exc)
regdata = {}
self.state.inject_globals = {'__reg__': regdata}
self.event = salt.utils.event.get_master_event(