c.b.s.BuildDSlave(object) : class documentation

Part of canonical.buildd.slave View In Hierarchy

Build Daemon slave. Implementation of most needed functions for a Build-Slave device.
Method __init__ Undocumented
Method getArch Return the Architecture tag for the slave.
Method cachePath Return the path in the cache of the file specified.
Method setupAuthHandler Set up a BasicAuthHandler to open the url.
Method ensurePresent Ensure we have the file with the checksum specified.
Method storeFile Take the provided content and store it in the file cache.
Method addWaitingFile Add a file to the cache and store its details for reporting.
Method fetchFile Fetch the file of the given sha1sum.
Method abort Abort the current build.
Method clean Clean up pending files and reset the internal build state.
Method log Write the provided data to the log.
Method getLogTail Return the tail of the log.
Method startBuild Start a build with the provided BuildManager instance.
Method emptyLog Empty the log and start again.
Method builderFail Cease building because the builder has a problem.
Method chrootFail Cease building because the chroot could not be created or contained
Method buildFail Cease building because the package failed to build.
Method buildOK Having passed all possible failure states, mark a build as OK.
Method depFail Cease building due to a dependency issue.
Method giveBack Give-back package due to a transient buildd/archive issue.
Method buildComplete Mark the build as complete and waiting interaction from the build
Method sanitizeBuildlog Removes passwords from buildlog URLs.
def __init__(self, config):
Undocumented
def getArch(self):
Return the Architecture tag for the slave.
def cachePath(self, file):
Return the path in the cache of the file specified.
def setupAuthHandler(self, url, username, password):
Set up a BasicAuthHandler to open the url.

This helper installs a urllib2.HTTPBasicAuthHandler that will deal with any HTTP basic authentication required when opening the URL.

ParametersurlThe URL that needs authenticating.
usernameThe username for authentication.
passwordThe password for authentication.
ReturnsThe OpenerDirector instance.
def ensurePresent(self, sha1sum, url=None, username=None, password=None):
Ensure we have the file with the checksum specified.

Optionally you can provide the librarian URL and the build slave will fetch the file if it doesn't have it. Return a tuple containing: (<present>, <info>)

def storeFile(self, content):
Take the provided content and store it in the file cache.
def addWaitingFile(self, path):
Add a file to the cache and store its details for reporting.
def fetchFile(self, sha1sum):
Fetch the file of the given sha1sum.
def abort(self):
Abort the current build.
def clean(self):
Clean up pending files and reset the internal build state.
def log(self, data):
Write the provided data to the log.
def getLogTail(self):
Return the tail of the log.

If the buildlog is not yet opened for writing (self._log is None), return a empty string.

It safely tries to open the 'buildlog', if it doesn't exist, due to job cleanup or buildlog sanitization race-conditions, it also returns an empty string.

When the 'buildlog' is present it return up to 2 KiB character of the end of the file.

The returned content will be 'sanitized', see _sanitizeURLs for further information.

def startBuild(self, manager):
Start a build with the provided BuildManager instance.
def emptyLog(self):
Empty the log and start again.
def builderFail(self):
Cease building because the builder has a problem.
def chrootFail(self):
Cease building because the chroot could not be created or contained a set of package control files which couldn't upgrade themselves, or yet a lot of causes that imply the CHROOT is corrupted not the package.
def buildFail(self):
Cease building because the package failed to build.
def buildOK(self):
Having passed all possible failure states, mark a build as OK.
def depFail(self, dependencies):
Cease building due to a dependency issue.
def giveBack(self):
Give-back package due to a transient buildd/archive issue.
def buildComplete(self):
Mark the build as complete and waiting interaction from the build daemon master.
def sanitizeBuildlog(self, log_path):
Removes passwords from buildlog URLs.

Because none of the URLs to be processed are expected to span multiple lines and because build log files are potentially huge they will be processed line by line.

Parameterslog_pathThe path to the buildlog file that is to be sanitized. (type: str)
API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.