'Handle copying of rsync:// and rsync-over-ssh repos.'

def rsync_sync(self, repo):

    if (not repo.mirror_locally):
        utils.die(self.logger, 'rsync://    urls    must    be    mirrored    locally,    yum    cannot    access    them    directly')
    if ((repo.rpm_list != '') and (repo.rpm_list != [])):
        self.logger.warning("--rpm-list    is    not    supported    for    rsync'd    repositories")
    dest_path = os.path.join((self.settings.webdir + '/repo_mirror'), repo.name)
    spacer = ''
    if ((not repo.mirror.startswith('rsync://')) and (not repo.mirror.startswith('/'))):
        spacer = '-e    ssh'
    if (not repo.mirror.strip().endswith('/')):
        repo.mirror = ('%s/' % repo.mirror)
    cmd = ('rsync    -rltDv    --copy-unsafe-links    --delete-after    %s    --delete    --exclude-from=/etc/cobbler/rsync.exclude    %s    %s' % (spacer, repo.mirror, dest_path))
    rc = utils.subprocess_call(self.logger, cmd)
    if (rc != 0):
        utils.die(self.logger, 'cobbler    reposync    failed')
    os.path.walk(dest_path, self.createrepo_walker, repo)
    self.create_local_file(dest_path, repo)
