repoman.common.stores package¶
Submodules¶
repoman.common.stores.iso module¶
This module holds the class and methods to manage an iso store:
repository_dir
└── 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
-
extension
¶
-
full_name
¶ 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).
-
name
¶
-
type
¶
-
version
¶
-
-
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
-
CONFIG_SECTION
= 'IsoStore'¶
-
DEFAULT_CONFIG
= {'path_prefix': 'iso', 'signing_key': '', 'signing_passphrase': 'ask', 'temp_dir': 'generate'}¶
-
add_artifact
(iso, **args)[source]¶ This method adds an artifact to the store
Parameters: artifact – full path or url to the artifact
-
add_iso
(iso, onlyifnewer=False, to_copy=True, hidelog=False)[source]¶ Generic functon to add an iso package to the repo.
Parameters: - 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)
-
change_path
(new_path)[source]¶ Changes the store path to the given one, copying any artifacts if needed
Parameters: new_path (str) – New path to set Returns: None
-
delete_old
(keep=1, noop=False)[source]¶ Delete the oldest versions for each package from the repo
Parameters: - 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.
Parameters: - 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
-
handles_artifact
(artifact_str)[source]¶ This method must return True if the given artifact (as a path or url) can be handled by the implemented store
Parameters: artifact_str – full path or url to the artifact
-
is_latest_version
(iso)[source]¶ Check if the given iso is the latest version in the repo
Parameters: iso – ISO instance of the package to compare
-
path_prefix
¶