lister/tasks: Standardize return statements
The following commit adapts the return statements from both lister and their associated tasks. This standardizes on what other modules (e.g. both dvcs and package loaders) do.
This commit is contained in:
parent
ff7fdf24db
commit
4a9608f31c
15 changed files with 42 additions and 21 deletions
|
@ -216,12 +216,14 @@ class DebianLister(ListerHttpTransport, ListerBase):
|
|||
.one_or_none()
|
||||
|
||||
if not distribution:
|
||||
raise ValueError("Distribution %s is not registered" %
|
||||
self.distribution)
|
||||
logger.error("Distribution %s is not registered" %
|
||||
self.distribution)
|
||||
return {'status': 'failed'}
|
||||
|
||||
if not distribution.type == 'deb':
|
||||
raise ValueError("Distribution %s is not a Debian derivative" %
|
||||
distribution)
|
||||
logger.error("Distribution %s is not a Debian derivative" %
|
||||
distribution)
|
||||
return {'status': 'failed'}
|
||||
|
||||
date = self.date
|
||||
|
||||
|
@ -250,4 +252,4 @@ class DebianLister(ListerHttpTransport, ListerBase):
|
|||
|
||||
self.db_session.commit()
|
||||
|
||||
return True
|
||||
return {'status': 'eventful'}
|
||||
|
|
|
@ -10,7 +10,7 @@ from .lister import DebianLister
|
|||
@shared_task(name=__name__ + '.DebianListerTask')
|
||||
def list_debian_distribution(distribution, **lister_args):
|
||||
'''List a Debian distribution'''
|
||||
DebianLister(distribution=distribution, **lister_args).run()
|
||||
return DebianLister(distribution=distribution, **lister_args).run()
|
||||
|
||||
|
||||
@shared_task(name=__name__ + '.ping')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue