repoman.common.stores package


repoman.common.stores.iso module

This module holds the class and methods to manage an iso store:

└── iso
    ├── $project1
    │   │   ├── $version
    │   │   |   ├── $iso1
    │   |   │   ├── $iso1.md5sum
    │   │   |   └── $iso1.md5sum.sig
    │   │   └── ...
    │   └── ...
    └── ...
class repoman.common.stores.iso.Iso(path, temp_dir, verify_ssl=True)[source]

Bases: repoman.common.artifact.Artifact


Unique ISO Name.

This property should uniquely identify an ISO entity, in the sense that if you have two isos with the same full_name they must package the same content or one of them is wrongly generated (the version was not bumped or something).

sign(key, passwd)[source]
class repoman.common.stores.iso.IsoStore(config, repo_path=None)[source]

Bases: repoman.common.stores.ArtifactStore

Represents the repository sctructure, it does not require that the repo has the structure specified in the module doc when loading it, but when adding new isos it will create the new files in that directory structure.

Configuration options:

  • temp_dir
    Temporary dir to store any transient downloads (like isos from urls). The caller should make sure it exists and clean it up if needed.
  • path_prefix
    Prefixes of this store inside the globl artifact repository, separated by commas
  • signing_key
    Path to the gpg keey to sign the isos with, will not sign them if not set
  • signing_passphrase
    Passphrase for the above key
DEFAULT_CONFIG = {'signing_passphrase': 'ask', 'signing_key': '', 'temp_dir': 'generate', 'path_prefix': 'iso'}
add_artifact(iso, **args)[source]
add_iso(iso, onlyifnewer=False, to_copy=True, hidelog=False)[source]

Generic functon to add an iso package to the repo.

  • iso – path or url to the iso file to add
  • onlyifnewer – If set to True, will only add the package if it’s not there already or the version is newer than the on already there.
  • to_copy – If set to True, will add that package to the list of packages to copy into the repo when saving, usually used when adding new packages to the repo.
  • hidelog – If set to True will not show the extra information (used when loading a repository to avoid verbose output)

Changes the store path to the given one, copying any artifacts if needed

Parameters:new_path (str) – New path to set
delete_old(keep=1, noop=False)[source]

Delete the oldest versions for each package from the repo

  • keep – Maximium number of versions to keep of each package
  • noop – If set, will only log what will be done, not actually doing anything.
get_artifacts(regmatch=None, fmatch=None)[source]

Get the list of isos, filtered or not.

  • regmatch – Regular expression that will be applied to the path of each package to filter it
  • fmatch – Filter function that must return True for a package to be selected, will be passed the iso object as only parameter
get_latest(regmatch=None, fmatch=None, num=1)[source]

Return the num latest versions for each iso in the repo

Parameters:num – number of latest versions to return

Check if the given iso is the latest version in the repo

Parameters:iso – ISO instance of the package to compare

Sign all the isos in the repo.

exception repoman.common.stores.iso.WrongIsoError[source]

Bases: exceptions.Exception

Any iso failure