tasks: fix handling of unsupported promise.save() calls

the exception can also be an AttributeError.

Also do not reraise this exception (in github/tasks.py). This promise
saving feature is used for tests.
This commit is contained in:
David Douard 2019-04-11 11:01:26 +02:00
parent 0b8d1d464d
commit e5c3559033
3 changed files with 3 additions and 4 deletions

View file

@ -38,7 +38,7 @@ def full_bitbucket_relister(self, split=None, **lister_args):
self.log.debug('%s OK (spawned %s subtasks)' % (self.name, len(ranges)))
try:
promise.save() # so that we can restore the GroupResult in tests
except NotImplementedError:
except (NotImplementedError, AttributeError):
self.log.info('Unable to call save_group with current result backend.')
return promise.id

View file

@ -38,9 +38,8 @@ def full_github_relister(self, split=None, **lister_args):
self.log.debug('%s OK (spawned %s subtasks)' % (self.name, len(ranges)))
try:
promise.save() # so that we can restore the GroupResult in tests
except NotImplementedError:
except (NotImplementedError, AttributeError):
self.log.info('Unable to call save_group with current result backend.')
raise
return promise.id

View file

@ -47,7 +47,7 @@ def full_gitlab_relister(self, **lister_args):
self.log.debug('%s OK (spawned %s subtasks)' % (self.name, len(ranges)))
try:
promise.save()
except NotImplementedError:
except (NotImplementedError, AttributeError):
self.log.info('Unable to call save_group with current result backend.')
return promise.id