mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #22860 from nmadhok/patch-runtime-error
Fixing issue that causes RuntimeError maximum recursion Fixes #22839
This commit is contained in:
commit
645480423c
@ -98,7 +98,15 @@ class LazyDict(collections.MutableMapping):
|
||||
'''
|
||||
Check if the name is in the dict and return it if it is
|
||||
'''
|
||||
if name in self:
|
||||
if name not in self._dict and not self.loaded:
|
||||
# load the item
|
||||
if self._load(name):
|
||||
log.debug('LazyLoaded {0}'.format(name))
|
||||
return self._dict[name]
|
||||
else:
|
||||
log.debug('Could not LazyLoad {0}'.format(name))
|
||||
raise KeyError(name)
|
||||
elif name in self:
|
||||
return self[name]
|
||||
raise AttributeError(name)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user