plainbox.impl.job – job definition

Warning

THIS MODULE DOES NOT HAVE STABLE PUBLIC API

class plainbox.impl.job.CheckBoxJobValidator[source]

Validator for CheckBox jobs.

static validate(job)[source]

Validate the specified job

class plainbox.impl.job.JobDefinition(data, origin=None, provider=None, controller=None)[source]

Job definition class.

Thin wrapper around the RFC822 record that defines a checkbox job definition

automated[source]

Whether the job is fully automated and runs without any intervention from the user

controller[source]

The controller object associated with this JobDefinition

create_child_job_from_record(record)[source]

Create a new JobDefinition from RFC822 record.

This method should only be used to create additional jobs from local jobs (plugin local). This ensures that the child job shares the embedded provider reference.

depends[source]
description[source]
estimated_duration[source]

estimated duration of this job in seconds.

The value may be None, which indicates that the duration is basically unknown. Fractional numbers are allowed and indicate fractions of a second.

class fields[source]

Symbols for each field that a JobDefinition can have

command = Symbol('command')
description = Symbol('description')
environ = Symbol('environ')
estimated_duration = Symbol('estimated_duration')
classmethod get_all_symbols()

Get all symbols defined by this symbol definition block

name = Symbol('name')
plugin = Symbol('plugin')
user = Symbol('user')
classmethod JobDefinition.from_rfc822_record(record)[source]

Create a JobDefinition instance from rfc822 record

The record must be a RFC822Record instance.

Only the ‘name’ and ‘plugin’ keys are required. All other data is stored as is and is entirely optional.

JobDefinition.get_direct_dependencies()[source]

Compute and return a set of direct dependencies

To combat a simple mistake where the jobs are space-delimited any mixture of white-space (including newlines) and commas are allowed.

JobDefinition.get_record_value(name, default=None)[source]

Obtain the value of the specified record attribute

JobDefinition.get_resource_dependencies()[source]

Compute and return a set of resource dependencies

JobDefinition.get_resource_program()[source]

Return a ResourceProgram based on the ‘requires’ expression.

The program instance is cached in the JobDefinition and is not compiled or validated on subsequent calls.

Returns ResourceProgram or None Raises ResourceProgramError or SyntaxError

JobDefinition.name[source]
JobDefinition.origin[source]

The Origin object associated with this JobDefinition

JobDefinition.plugin[source]
JobDefinition.provider[source]

The provider object associated with this JobDefinition

JobDefinition.requires[source]
JobDefinition.startup_user_interaction_required[source]

The job needs to be started explicitly by the test operator. This is intended for things that may be timing-sensitive or may require the tester to understand the necessary manipulations that he or she may have to perform ahead of time.

The test operator may select to skip certain tests, in that case the outcome is skip.

JobDefinition.update_origin(origin)[source]

Change the Origin object associated with this JobDefinition

Note

This method is a unfortunate side effect of how via and local jobs that cat existing jobs are implemented. Ideally jobs would be trully immutable. Do not use this method lightly.

JobDefinition.validate(validator_cls=<class 'plainbox.impl.job.CheckBoxJobValidator'>)[source]

Validate this job definition with the specified validator

Raises ValidationError:
 If the job has any problems that make it unsuitable for execution.
JobDefinition.via[source]

The checksum of the “parent” job when the current JobDefinition comes from a job output using the local plugin

class plainbox.impl.job.JobOutputTextSource(job)[source]

A ITextSource subclass indicating that text came from job output.

This class is used by SessionState._gen_rfc822_records_from_io_log() to allow such (generated) jobs to be traced back to the job that generated them.

Variables:jobplainbox.impl.job.JobDefinition instance that generated the text
class plainbox.impl.job.Problem[source]

Symbols for each possible problem that a field value may have

classmethod get_all_symbols()

Get all symbols defined by this symbol definition block

missing = Symbol('missing')
useless = Symbol('useless')
wrong = Symbol('wrong')
exception plainbox.impl.job.ValidationError(field, problem)[source]

Exception raised by to report jobs with problematic definitions.

class plainbox.impl.job.propertywithsymbols(fget=None, fset=None, fdel=None, doc=None, symbols=None)[source]

A property that also keeps a group of symbols around

Previous topic

plainbox.impl.integration_tests – integration tests

Next topic

plainbox.impl.logging – configuration for logging

This Page