Merge pull request #31189 from dmacvicar/dmacvicar-2015.8-31106

Fix crash with scheduler and runners (#31106)
This commit is contained in:
Mike Place 2016-02-16 11:49:36 -07:00
commit 62d76902ce
2 changed files with 10 additions and 1 deletions

View file

@ -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()

View file

@ -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']))