Added exception handler to trap the RuntimeError raised when

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 #23839 and #23373.
This commit is contained in:
Stephen Spencer 2015-05-19 03:56:06 -05:00 committed by rallytime
parent 02a78fce3d
commit 197688ef0c

View File

@ -1065,7 +1065,12 @@ class LazyLoader(salt.utils.lazy.LazyDict):
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