kentauros.modules.uploader package

Submodules

kentauros.modules.uploader.abstract module

This module contains the abstract Uploader class, which is then inherited by actual upload classes.

class kentauros.modules.uploader.abstract.Uploader(package)[source]

Bases: kentauros.modules.module.PkgModule

This class serves as a quasi-abstract base class for source package uploader classes. They are expected to override this class’s methods as necessary.

Parameters:package (Package) – package for which this constructor is for
Variables:upkg (Package) – stores parent package instance reference
status() → dict[source]

This method is expected to return a dictionary of statistics about the respective uploader.

upload()[source]

This method executes the source package upload with the settings specified in the package configuration.

kentauros.modules.uploader.copr module

This module contains the CoprUploader class, which can be used to upload .src.rpm packages to copr.

class kentauros.modules.uploader.copr.CoprUploader(package)[source]

Bases: kentauros.modules.uploader.abstract.Uploader

This Uploader subclass implements methods for all stages of uploading source packages. At class instantiation, it checks for existence of the copr-cli binary. If it is not found in $PATH, this instance is set to inactive.

Parameters:package (Package) – package for which this src.rpm uploader is for
Variables:active (bool) – determines if this instance is active
clean() → bool[source]

This method is expected to clean up a sub-module’s files and folders, if it creates any during its execution.

Returns:bool – boolean indicating whether cleaning up was successful
execute() → bool[source]

This method is expected to execute the package module and return a boolean, indicating whether the execution finished successfully or not.

Returns:bool – boolean indicating whether the execution was successful
get_active()[source]
Returns:bool – boolean value indicating whether this builder should be active
get_dists()[source]
Returns:list – list of chroots that are going to be used for sequential builds
get_keep()[source]
Returns:bool – boolean value indicating whether this builder should keep source packages
get_repo()[source]
Returns:str – name of the repository to upload to
get_wait()[source]
Returns:bool – boolean value indicating whether this builder should wait for remote builds
imports() → dict[source]

This method is expected to return a dictionary of statistics about a module that has not yet been imported into the package database.

Returns:dict – dictionary containing the sub-module’s imported stats
status() → dict[source]

This method is expected to return a dictionary of statistics about the respective uploader.

status_string() → str[source]

This method is expected to return a string describing the status of this module.

Returns:str – string containing module statistics
upload() → bool[source]

This method executes the upload of the newest SRPM package found in the package directory. The invocation of copr-cli also includes the chroot settings set in the package configuration file.

Returns:bool – returns False if anything goes wrong, True otherwise
verify() → bool[source]

This method runs several checks to ensure copr uploads can proceed. It is automatically executed at package initialisation. This includes:

  • checks if all expected keys are present in the configuration file
  • checks if the copr-cli binary is installed and can be found on the system
Returns:bool – verification success
kentauros.modules.uploader.copr.LOG_PREFIX = 'ktr/uploader/copr'

This string specifies the prefix for log and error messages printed to stdout or stderr from inside this subpackage.

Module contents

This subpackage contains the Uploader base class and CoprUploader, which is used for holding information about a package’s upload location or method (if defined in package configuration). Additionally, this file contains a dictionary which maps UploaderType enums to their respective class constructors.

kentauros.modules.uploader.UPLOADER_TYPE_DICT = {<UploaderType.COPR: 1>: <class 'kentauros.modules.uploader.copr.CoprUploader'>}

This dictionary maps UploaderType enum members to their respective Uploader subclass constructors.