Skip to content

Commit

Permalink
Added exception handler to trap the RuntimeError raised when
Browse files Browse the repository at this point in the history
Depends.enforce_dependency() class method fires unsuccessfully. There appears
to be no synchronization within the Depends decorator class wrt the
class global dependency_dict which results in incomplete population of any
loader instantiation occuring at the time of one of these exceptions.

This would mitigate the immediate affects of saltstack#23839 and saltstack#23373.
  • Loading branch information
gladiatr72 authored and rallytime committed May 20, 2015
1 parent 02a78fc commit 197688e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion salt/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,12 @@ def _load_module(self, name):
self._apply_outputter(func, mod)

# enforce depends
Depends.enforce_dependencies(self._dict, self.tag)
try:
Depends.enforce_dependencies(self._dict, self.tag)
except RuntimeError as e:
log.info('Depends.enforce_dependencies() failed '
'for reasons: '.format(e))

self.loaded_modules[module_name] = mod_dict
return True

Expand Down

0 comments on commit 197688e

Please sign in to comment.