~zyga/checkbox/load-all-jobs

Viewing all changes in revision 2579.

  • Committer: Zygmunt Krynicki
  • Date: 2013-12-23 16:54:38 UTC
  • Revision ID: zygmunt.krynicki@canonical.com-20131223165438-sm7i5ve9qg1qid1g
plainbox:secure:providers: add Provider1.load_all_jobs()

This method acts just like get_builtin_job() that it replaces with two
important differences. First, it never raises RFC822SyntaxError, instead
it collects all such exceptions into a list. This allows it to keep
loading jobs from subsequent files even if the first file has a syntax
problem early on. Second is that the full list of problems is returned
to the caller.

This allows it to be more resilient in face of user errors and makes it
a valuable method to have for tools that are aimed at provider developers.

The old get_builtin_jobs() is retained for compatibility but has been
re-implemented on top of load_all_jobs().

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: