7.1.3.2. core Package

7.1.3.2.1. mirror_config Module

Convert from a site mirror config to a PulpDist repo config

class pulpdist.core.mirror_config.MirrorConverter(mirror)[source]

Bases: object

build_importer_config()[source]
build_notes()[source]
pulpdist.core.mirror_config.make_repo(mirror)[source]
pulpdist.core.mirror_config.make_repo_id(mirror_id, site_id)[source]

Derive a Pulp repo ID from a mirror ID and a site ID

7.1.3.2.2. pulpapi Module

7.1.3.2.3. repo_config Module

Config definitions and helpers for pulpdist importer plugins

class pulpdist.core.repo_config.RepoConfig(config)[source]

Bases: pulpdist.core.validation.ValidatedConfig

validate()[source]

7.1.3.2.4. shellutil Module

shellutil - additional shell utilities (beyond the standard library’s shutil)

class pulpdist.core.shellutil.WalkedDir(path, subdirs, files, depth)

Bases: tuple

depth

Alias for field number 3

files

Alias for field number 2

path

Alias for field number 0

subdirs

Alias for field number 1

pulpdist.core.shellutil.filtered_walk(top, file_pattern=None, dir_pattern=None, excluded_files=None, excluded_dirs=None, depth=None, followlinks=False, onerror=None, onloop=None)[source]

filtered_walk is similar to os.walk, but offers the following additional features:

  • yields a named tuple of (path, subdirs, files, depth)
  • allows independent glob-style filters for filenames and subdirectories
  • allows independent exclusion filters for filenames and subdirectories
  • emits a message to stderr and skips the directory if a symlink loop is encountered when following links
  • allows a recursion depth limit to be specified

Selective walks are always top down, as the directory listings must be altered to provide the above features. If not None, depth must be at least 0. A depth of zero can be useful to get separate filtered subdirectory and file listings for a given directory.

onerror is passed to os.walk to handle os.listdir errors onloop (if provided) can be used to override the default symbolic loop handling. It is called with the directory path as an argument when a loop is detected. Any false return value will skip the directory, any true value means the directory will be processed as normal.

pulpdist.core.shellutil.temp_dir(*args, **kwds)[source]

7.1.3.2.5. site_config Module

7.1.3.2.6. site_sql Module

7.1.3.2.7. sync_config Module

Config definitions and helpers for pulpdist importer plugins

class pulpdist.core.sync_config.SnapshotSyncConfig(config=None)[source]

Bases: pulpdist.core.sync_config.VersionedSyncConfig

class pulpdist.core.sync_config.TreeSyncConfig(config=None)[source]

Bases: pulpdist.core.validation.ValidatedConfig

class pulpdist.core.sync_config.VersionedSyncConfig(config=None)[source]

Bases: pulpdist.core.sync_config.TreeSyncConfig

pulpdist.core.sync_config.retrieves_listing(sync_type)[source]

7.1.3.2.8. sync_trees Module

sync_trees - utilities for synchronising trees with rsync

class pulpdist.core.sync_trees.BaseSyncCommand(config, log_dest=None)[source]

Bases: object

CONFIG_TYPE = None
DRY_RUN_SUFFIX = '_DRY_RUN'
SYNC_COMPLETED = 'SYNC_COMPLETED'
SYNC_DISABLED = 'SYNC_DISABLED'
SYNC_FAILED = 'SYNC_FAILED'
SYNC_PARTIAL = 'SYNC_PARTIAL'
SYNC_UP_TO_DATE = 'SYNC_UP_TO_DATE'
fetch_dir(remote_source_path, local_dest_path, local_seed_paths=())[source]

Fetch a single directory from the remote server

run_sync()[source]

Execute the full synchronisation task

Ensures the sync log is flushed before returing

class pulpdist.core.sync_trees.SyncFromDelta[source]

Bases: pulpdist.core.sync_trees.BaseSyncCommand

Create a new local snapshots from an upstream delta

class pulpdist.core.sync_trees.SyncSnapshotDelta[source]

Bases: pulpdist.core.sync_trees.BaseSyncCommand

Create an rsync delta from a snapshot directory

class pulpdist.core.sync_trees.SyncSnapshotTree(config, log_dest=None)[source]

Bases: pulpdist.core.sync_trees.SyncVersionedTree

Sync the contents of a directory containing multiple snapshots of a tree

CONFIG_TYPE

alias of SnapshotSyncConfig

class pulpdist.core.sync_trees.SyncStats[source]

Bases: pulpdist.core.sync_trees.SyncStats

classmethod from_rsync_output(raw_data, old_daemon=False)[source]
class pulpdist.core.sync_trees.SyncTree(config, log_dest=None)[source]

Bases: pulpdist.core.sync_trees.BaseSyncCommand

Sync the contents of a directory

CONFIG_TYPE

alias of TreeSyncConfig

class pulpdist.core.sync_trees.SyncVersionedTree(config, log_dest=None)[source]

Bases: pulpdist.core.sync_trees.BaseSyncCommand

Sync the contents of a directory containing multiple versions of a tree

CONFIG_TYPE

alias of VersionedSyncConfig

remote_ls(remote_ls_path)[source]

7.1.3.2.9. util Module

util - miscellaneous utility functions

pulpdist.core.util.call_repr(name, args)[source]
pulpdist.core.util.format_iter(iterable, fmt='{0!r}', sep=', ')[source]
pulpdist.core.util.obj_repr(obj, fields)[source]

7.1.3.2.10. validation Module

Simple validation for JSON compatible data structures

class pulpdist.core.validation.ValidatedConfig(config=None)[source]

Bases: object

classmethod check()[source]
classmethod ensure_validated(config)[source]

Returns a mapping that has been validated against the spec

classmethod from_json(json_config)[source]

Read the config from a JSON file and ensure it is valid

classmethod post_validate(value)[source]
validate()[source]
exception pulpdist.core.validation.ValidationError[source]

Bases: exceptions.Exception

pulpdist.core.validation.check_host(allow_none=False)[source]
pulpdist.core.validation.check_mapping(spec, allow_none=False, allow_extra=False)[source]
pulpdist.core.validation.check_mapping_items(key_validator, value_validator, allow_none=False)[source]
pulpdist.core.validation.check_path(allow_none=False)[source]
pulpdist.core.validation.check_pulp_id(expected='valid Pulp ID', allow_none=False)[source]
pulpdist.core.validation.check_regex(pattern, expected=None, allow_none=False)[source]
pulpdist.core.validation.check_remote_path(allow_none=False)[source]
pulpdist.core.validation.check_rsync_filter(allow_none=False)[source]
pulpdist.core.validation.check_rsync_filter_sequence()[source]
pulpdist.core.validation.check_sequence(item_validator, allow_none=False)[source]
pulpdist.core.validation.check_simple_id(expected='simple ID (alphanumeric, underscores, hyphens)', allow_none=False)[source]
pulpdist.core.validation.check_text(allow_none=False)[source]
pulpdist.core.validation.check_type(expected_type, allow_none=False)[source]
pulpdist.core.validation.check_value(allowed_values, allow_none=False)[source]
pulpdist.core.validation.fail_validation(fmt, *args, **kwds)[source]
pulpdist.core.validation.validate_config(config, spec, *args, **kwds)[source]