Submit Class

class htcondor2.Submit(input=None, **kwargs)

An object representing a job submit description. It uses the same language as condor_submit. Values in the submit description language have no type; they are all strings.

If input is a dictionary, it will be serialized into the submit language. Otherwise, input is a string in the submit language.

If keyword arguments are supplied, they will update this object after the submit-language string, if any, is parsed.

This object implements the Python dictionary protocol, except that attempts to del() entries will raise a NotImplementedError because the underlying logic does not distinguish between a missing key and a key whose value is the empty string. (This seems better than allowing you to del(s[key]) but having key still appear in s.keys().)

expand(attr)

Expand all macros for the given attribute.

Parameters

attr (str) – The name of the attribute to expand.

Returns

The value of the given attribute, with all macros expanded.

Return type

str

static from_dag(filename, options={})

Returns a Submit object that can be used to submit the DAG specified in the file filename.

Parameters
Return type

Submit

static from_dag_options()

Prints a table of valid keys for the options dictionary passed to from_dag(), the type of each key, and the short description from condor_submit_dag’s -help output.

This function is useful if you don’t have an installed copy of condor_submit_dag or if this module and that command-line tool could be from different versions.

Note

Not all options available to condor_submit_dag exist for the python bindings.

getQArgs()

Return the arguments to the queue statement.

Return type

str

getSubmitMethod()

Returns the submit method.

Return type

int

Returns

The integer value of the submit method. The symbolic value can be obtained from the SubmitMethod enumeration.

issue_credentials()

Issue credentials for this job description.

Note

As with condor_submit, this assumes that the local machine is the target AP.

Return type

Optional[str, None]

Returns

A string containing a URL that the submitter must visit in order to complete an OAuth2 flow, or None if no such visit is necessary.

itemdata(qargs=None)

Returns an iterator over the itemdata specified by the given arguments to a queue statement, suitable for passing to schedd.Submit().

s.itemdata() is equivalent to s.itemdata(s.getQAargs()).

Parameters

qargs (str) – A set of arguments for a queue statement.

Return type

Union[Iterator[str], Iterator[dict]]

jobs(count=0, itemdata=None, clusterid=1, procid=0, qdate=0, owner='')

This function is not currently implemented.

Parameters
  • count (int) –

  • itemdata (iter) –

  • clusterid (int) –

  • procid (int) –

  • qdate (int) –

  • owner (str) –

procs(count=0, itemdata=None, clusterid=1, procid=0, qdate=0, owner='')

This function is not currently implemented.

Parameters
  • count (int) –

  • itemdata (iter) –

  • clusterid (int) –

  • procid (int) –

  • qdate (int) –

  • owner (str) –

setQArgs(args)

Set the arguments to the queue statement. These arguments replace the arguments, if any, passed to the original constructor.

Parameters

args (str) – The queue arguments.

setSubmitMethod(method_value=-1, allow_reserved_values=False)

By default, jobs created by this class record (in the job ad attribute JobSubmitMethod) that they were submitted via the Python bindings. Calling this method before submitting allows you to change that. Values between 0 (inclusive) and 100 (exclusive) are reserved for htcondor2.SubmitMethod and can’t be set unless the allowed_reserved_values flag is True. Values less than 0 may be used to remove JobSubmitMethod from the job ad entirely.

Parameters
  • method_value (Union[SubmitMethod, int]) – The method to record.

  • allowed_reserved_values – Set to true to used a reserved method_value.