Allow a jobs posted book to be none by default

Not all users of jobs and jobboards are using the
associated book that accompanies a job, instead they
are fine with just using the name and the details
that can be provided for usage in their application.

Example: http://review.openstack.org/#/c/91763/

To allow the optional usage of books with jobs (which
is already supported) by default set the book to none
and allow it to be provided on a as needed basis.

Change-Id: I69e370a733e44c45c62177008838c259fd9c9a7c
This commit is contained in:
Joshua Harlow
2014-07-14 18:42:03 -07:00
parent 1a7de75b1e
commit 52b43f3e2f
2 changed files with 6 additions and 6 deletions

View File

@@ -432,7 +432,7 @@ class ZookeeperJobBoard(jobboard.NotifyingJobBoard):
else:
child_proc(request)
def post(self, name, book, details=None):
def post(self, name, book=None, details=None):
def format_posting(job_uuid):
posting = {

View File

@@ -118,14 +118,14 @@ class JobBoard(object):
"""
@abc.abstractmethod
def post(self, name, book, details=None):
def post(self, name, book=None, details=None):
"""Atomically creates and posts a job to the jobboard.
This posting allowing others to attempt to claim that job (and
subsequently work on that job). The contents of the provided logbook
must provide *enough* information for others to reference to
construct & work on the desired entries that are contained in that
logbook.
subsequently work on that job). The contents of the provided logbook,
details dictionary, or name (or a mix of these) must provide *enough*
information for consumers to reference to construct and perform that
jobs contained work (whatever it may be).
Once a job has been posted it can only be removed by consuming that
job (after that job is claimed). Any entity can post/propose jobs