Package backend :: Package satellite_tools :: Module satsync :: Class Syncer
[hide private]
[frames] | no frames]

Class Syncer

source code

high-level sychronization/import class NOTE: there should *ONLY* be one instance of this.

Instance Methods [hide private]
 
__init__(self, channels, listChannelsYN, check_rpms, forceAllErrata=False)
Base initialization.
source code
 
initialize(self)
Initialization that requires IO, etc.
source code
 
__del__(self) source code
 
_process_simple(self, remote_function_name, step_name)
Wrapper function that can process metadata that is relatively simple.
source code
 
processArches(self) source code
 
import_orgs(self) source code
 
processChannelFamilies(self) source code
 
_write_repomd(self, repomd_path, getRepomdFunc, repomdFileStreamFunc, label, timestamp) source code
 
_process_comps(self, backend, label, timestamp) source code
 
_process_modules(self, backend, label, timestamp) source code
 
process_channels(self)
push channels, channel-family and dist.
source code
 
_printChannel(self, label, channel_object, log_format, is_imported) source code
 
_printChannelTree(self, doEOSYN=1, doTyposYN=1)
pretty prints a tree of channel information
source code
 
_compute_channel_request(self)
channels request is verify and categorized.
source code
 
_get_channel_timestamp(self, channel) source code
 
_compute_unique_packages(self)
process package metadata for one channel at a time
source code
 
processShortPackages(self) source code
 
_diff_packages_process(self, chunk, channel_label) source code
 
_diff_packages(self) source code
 
_verify_missing_channel_packages(self, missing_channel_packages, sources=0)
Verify if all the missing packages are actually available somehow.
source code
 
_process_package(self, package_id, package, l_timestamp, row, m_channel_packages, m_fs_packages, check_rpms=1) source code
 
download_rpms(self) source code
 
_missing_not_cached_packages(self) source code
 
download_package_metadata(self) source code
 
download_srpms(self) source code
 
_compute_unique_source_packages(self)
process package metadata for one channel at a time
source code
 
_compute_not_cached_source_packages(self) source code
 
_diff_source_packages_process(self, chunk, channel_label) source code
 
_diff_source_packages(self) source code
 
download_source_package_metadata(self) source code
 
_compute_unique_kickstarts(self)
process package metadata for one channel at a time
source code
 
_compute_missing_kickstarts(self)
process package metadata for one channel at a time
source code
 
_download_kickstarts_file(self, chunk, channel_label) source code
 
download_kickstarts(self)
Downloads all the kickstart-related information
source code
 
_get_ks_file_stream(self, channel, kstree_label, relative_path) source code
 
_compute_missing_ks_files(self) source code
 
import_kickstarts(self)
Imports the kickstart-related information
source code
 
_compute_not_cached_errata(self) source code
 
_get_db_channel_errata(self)
Fetch the errata stored in the local satellite's database.
source code
 
_diff_errata(self)
Fetch the errata for this channel
source code
 
_diff_db_errata(self)
Compute errata that are missing from the satellite Kind of similar to diff_errata, if we had the timestamp and advisory information available
source code
 
download_errata(self) source code
 
_processWithProgressBar(self, batch, size, process_function, prompt=u'Downloading:', nevermorethan=None, process_function_args=()) source code
 
_process_batch(self, channel, batch, log_msg, process_function, prompt=u'Downloading:', process_function_args=(), nevermorethan=None, is_slow=False) source code
 
_import_packages_process(self, chunk, sources) source code
 
import_packages(self, sources=0) source code
 
_link_channel_packages(self) source code
 
import_errata(self) source code
 
_fetch_packages(self, channel, missing_fs_packages, sources=0) source code
 
_get_package_stream(self, channel, package_id, nvrea, sources)
returns (filepath, stream), so in the case of a "wire source", the return value is, of course, (None, stream)
source code
Static Methods [hide private]
 
_formatChannelExportType(channel)
returns pretty formated text with type of channel export
source code
 
_get_rel_package_path(nevra, org_id, source, checksum_type, checksum) source code
 
_verify_file(path, mtime, size, checksum_type, checksum)
Verifies if the file is on the filesystem and matches the mtime and checksum.
source code
 
_get_cached_package_batch(chunk, sources=0)
short-circuit the most common case
source code
 
_fix_erratum(erratum)
Replace the list of packages with references to short packages
source code
 
_bytes_to_fuzzy(b) source code
Class Variables [hide private]
  _query_compare_packages = '\n select p.id, c.checksum_t...
  _query_compare_source_packages = '\n select ps.id, c.ch...
  _query_get_db_errata = <spacewalk.server.rhnSQL.sql_base.State...
Method Details [hide private]

__init__(self, channels, listChannelsYN, check_rpms, forceAllErrata=False)
(Constructor)

source code 

Base initialization. Most work done in self.initialize() which needs to be called soon after instantiation.

_process_simple(self, remote_function_name, step_name)

source code 

Wrapper function that can process metadata that is relatively simple. This does the decoding of data (over the wire or from disk).

step_name is just for pretty printing the actual --step name to the console.

The remote function is passed by name (as a string), to mimic the lazy behaviour of the if block

process_channels(self)

source code 

push channels, channel-family and dist. map information as well upon parsing.

_compute_channel_request(self)

source code 

channels request is verify and categorized.

NOTE: self.channel_req *will be* initialized by this method

_verify_missing_channel_packages(self, missing_channel_packages, sources=0)

source code 

Verify if all the missing packages are actually available somehow. In an incremental approach, one may request packages that are actually not available in the current dump, probably because of applying an incremental to the wrong base

_verify_file(path, mtime, size, checksum_type, checksum)
Static Method

source code 

Verifies if the file is on the filesystem and matches the mtime and checksum.
Computing the checksum is costly, that's why we rely on mtime comparisons.
Returns errcode:
    0   - file is ok, it has either the specified mtime and size
                  or checksum matches (then function sets mtime)
    1   - file does not exist at all
    2   - file has a different checksum

_get_db_channel_errata(self)

source code 

Fetch the errata stored in the local satellite's database. Returned as a hash of channel to another hash of advisory names to a tuple of errata id and last modified date.


Class Variable Details [hide private]

_query_compare_packages

Value:
'''
        select p.id, c.checksum_type, c.checksum, p.path, p.package_si\
ze,
               TO_CHAR(p.last_modified, \'YYYYMMDDHH24MISS\') last_mod\
ified
          from rhnPackage p, rhnChecksumView c
         where p.name_id = lookup_package_name(:name)
           and p.evr_id = lookup_evr(:epoch, :version, :release)
...

_query_compare_source_packages

Value:
'''
        select ps.id, c.checksum_type, c.checksum, ps.path, ps.package\
_size,
               TO_CHAR(ps.last_modified, \'YYYYMMDDHH24MISS\') last_mo\
dified
          from rhnPackageSource ps, rhnChecksumView c
         where ps.source_rpm_id = lookup_source_name(:package_id)
           and (ps.org_id = :org_id or
...

_query_get_db_errata

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998091136184\
8; statement=
        select e.id, e.advisory_name,
               TO_CHAR(e.last_modified, 'YYYYMMDDHH24MISS') last_modif\
ied
          from rhnChannelErrata ce, rhnErrata e, rhnChannel c
         where c.label = :channel
           and ce.channel_id = c.id
...