Package pulp :: Package server :: Module util
[hide private]
[frames] | no frames]

Module util

source code

Classes [hide private]
  Singleton
Singleton metaclass.
Functions [hide private]
 
get_rpm_information(rpm_path)
Get metadata about an RPM.
source code
 
random_string()
Generates a random string suitable for using as a password.
source code
 
chunks(l, n)
Split an array into n# of chunks.
source code
 
get_file_checksum(hashtype="sha", filename=None, fd=None, file=None, buffer_size=None)
Compute a file's checksum.
source code
 
get_string_checksum(hashtype, data)
Return checksum of a string
source code
 
get_file_timestamp(filename)
Returns a timestamp
source code
 
get_repomd_filetypes(repomd_path)
Returns: List of available metadata types
source code
 
_get_yum_repomd(path) source code
 
get_repo_package(repo_path, package_filename) source code
 
get_repo_packages(path)
Returns: List of available packages objects in the repo.
source code
 
get_repomd_filetype_path(path, filetype)
Returns: Path for filetype, or None
source code
 
listdir(directory)
List the packages in the given directory.
source code
 
compare_packages(pkgA, pkgB)
return 1: pkgA is newer than pkgB return 0: pkgA equals pkgB return -1: pkgB is newer than pkgA
source code
 
check_package_exists(pkg_path, hashsum, hashtype="sha", force=0) source code
Variables [hide private]
  log = logging.getLogger(__name__)
Function Details [hide private]

get_rpm_information(rpm_path)

source code 

Get metadata about an RPM.

Parameters:
  • rpm_path - Full path to the RPM to inspect

chunks(l, n)

source code 

Split an array into n# of chunks. Taken from : http://tinyurl.com/y8v5q2j

get_string_checksum(hashtype, data)

source code 

Return checksum of a string

Parameters:
  • hashtype - hashtype, example "sha256"
  • data - string to get checksum
Returns:
checksum

get_file_timestamp(filename)

source code 

Returns a timestamp

Parameters:
  • filename - filename path to file
Returns:
filename's timestamp

get_repomd_filetypes(repomd_path)

source code 
Parameters:
  • repomd_path - path to repomd.xml
Returns:
List of available metadata types

_get_yum_repomd(path)

source code 
Parameters:
  • path - path to repo @return yum.yumRepo.YumRepository object initialized for querying repodata

get_repo_package(repo_path, package_filename)

source code 
Parameters:
  • repo_path - The file system path to the repository you wish to fetch the package metadata from
  • package_filename - the filename of the package you want the metadata for

get_repo_packages(path)

source code 
Parameters:
  • path - path to repo's base (not the repodatadir, this api expects a path/repodata underneath this path)
Returns:
List of available packages objects in the repo.

get_repomd_filetype_path(path, filetype)

source code 
Parameters:
  • path - path to repo
  • filetype - metadata type to query, example "group", "primary", etc
Returns:
Path for filetype, or None

listdir(directory)

source code 

List the packages in the given directory.

Parameters:
  • directory (str) - name of the directory
Returns:
list of 'directory/package name'