mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix crash with scheduler and runners (#31106)
* runner wrapper ClientFuncsDict do not provide access to 'pack' attribute * runners do not provide retcode, therefore ignore it in the schedule if it is not provided by __context__
This commit is contained in:
parent
c5e5af827c
commit
9ad8cb1e6b
2 changed files with 10 additions and 1 deletions
|
@ -53,6 +53,12 @@ class ClientFuncsDict(collections.MutableMapping):
|
|||
def __init__(self, client):
|
||||
self.client = client
|
||||
|
||||
def __getattr__(self, attr):
|
||||
'''
|
||||
Provide access eg. to 'pack'
|
||||
'''
|
||||
return getattr(self.client.functions, attr)
|
||||
|
||||
def __setitem__(self, key, val):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
|
|
@ -700,7 +700,10 @@ class Schedule(object):
|
|||
)
|
||||
)
|
||||
|
||||
ret['retcode'] = self.functions.pack['__context__']['retcode']
|
||||
# runners do not provide retcode
|
||||
if 'retcode' in self.functions.pack['__context__']:
|
||||
ret['retcode'] = self.functions.pack['__context__']['retcode']
|
||||
|
||||
ret['success'] = True
|
||||
except Exception:
|
||||
log.exception("Unhandled exception running {0}".format(ret['fun']))
|
||||
|
|
Loading…
Add table
Reference in a new issue