jenkinsapi.utils package

Submodules

jenkinsapi.utils.crumb_requester module

class jenkinsapi.utils.crumb_requester.CrumbRequester(*args, **kwargs)[source]

Bases: Requester

Adapter for Requester inserting the crumb in every request.

post_url(url, params=None, data=None, files=None, headers=None, allow_redirects=True, **kwargs)[source]

jenkinsapi.utils.jenkins_launcher module

exception jenkinsapi.utils.jenkins_launcher.FailedToStart[source]

Bases: Exception

class jenkinsapi.utils.jenkins_launcher.JenkinsLancher(local_orig_dir, systests_dir, war_name, plugin_urls=None, jenkins_url=None)[source]

Bases: object

Launch jenkins

JENKINS_LTS_WAR_URL = 'https://updates.jenkins.io/stable/latest/jenkins.war'
JENKINS_WEEKLY_WAR_URL = 'http://updates.jenkins.io/latest/jenkins.war'
block_until_jenkins_ready(timeout)[source]
install_plugin(hpi_url, plugin_dest_dir)[source]
install_plugins()[source]
start(timeout=60)[source]
stop()[source]
update_config()[source]
update_war()[source]
class jenkinsapi.utils.jenkins_launcher.StreamThread(name, q, stream, fn_log)[source]

Bases: Thread

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

stop()[source]
stopped()[source]
exception jenkinsapi.utils.jenkins_launcher.TimeOut[source]

Bases: Exception

jenkinsapi.utils.jsonp_to_json module

Module for converting jsonp to json.

jenkinsapi.utils.jsonp_to_json.jsonp_to_json(jsonp)[source]

jenkinsapi.utils.krb_requester module

Kerberos aware Requester

class jenkinsapi.utils.krb_requester.KrbRequester(*args, **kwargs)[source]

Bases: Requester

A class which carries out HTTP requests with Kerberos/GSSAPI authentication.

get_request_dict(params=None, data=None, files=None, headers=None, **kwargs)[source]

jenkinsapi.utils.manifest module

This module enables Manifest file parsing. Copied from https://chromium.googlesource.com/external/googleappengine/python/+/master /google/appengine/tools/jarfile.py

exception jenkinsapi.utils.manifest.InvalidJarError[source]

Bases: Exception

InvalidJar exception class

class jenkinsapi.utils.manifest.Manifest(main_section, sections)[source]

Bases: object

The parsed manifest from a jar file. Attributes:

main_section: a dict representing the main (first)

section of the manifest. Each key is a string that is an attribute, such as ‘Manifest-Version’, and the corresponding value is a string that is the value of the attribute, such as ‘1.0’.

sections: a dict representing the other sections of the manifest.

Each key is a string that is the value of the ‘Name’ attribute for the section, and the corresponding value is a dict like the main_section one, for the other attributes.

jenkinsapi.utils.manifest.read_manifest(jar_file_name)[source]

Read and parse the manifest out of the given jar. Args:

jar_file_name: the name of the jar from which the manifest is to be read.

Returns:

A parsed Manifest object, or None if the jar has no manifest.

Raises:

IOError: if the jar does not exist or cannot be read.

jenkinsapi.utils.requester module

Module for jenkinsapi requester (which is a wrapper around python-requests)

class jenkinsapi.utils.requester.Requester(*args, **kwargs)[source]

Bases: object

A class which carries out HTTP requests. You can replace this class with one of your own implementation if you require some other way to access Jenkins.

This default class can handle simple authentication only.

VALID_STATUS_CODES = [200]
get_and_confirm_status(url, params=None, headers=None, valid=None, stream=False)[source]
get_request_dict(params=None, data=None, files=None, headers=None, **kwargs)[source]
get_url(url, params=None, headers=None, allow_redirects=True, stream=False)[source]
post_and_confirm_status(url, params=None, data=None, files=None, headers=None, valid=None, allow_redirects=True)[source]
post_url(url, params=None, data=None, files=None, headers=None, allow_redirects=True, **kwargs)[source]
post_xml_and_confirm_status(url, params=None, data=None, valid=None)[source]

jenkinsapi.utils.simple_post_logger module

Module contents

Module __init__ for utils