lrossett / centos / centpkg

Forked from centos/centpkg 3 years ago
Clone
1963a5
# Copyright (c) 2020 - Red Hat Inc.
1963a5
#
1963a5
# This program is free software; you can redistribute it and/or modify it
1963a5
# under the terms of the GNU General Public License as published by the
1963a5
# Free Software Foundation; either version 2 of the License, or (at your
1963a5
# option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
1963a5
# the full text of the license.
1963a5
1963a5
1963a5
"""Interact with the Fedora lookaside cache
1963a5
1963a5
We need to override the pyrpkg.lookasidecache module to handle our custom
1963a5
download path.
1963a5
"""
1963a5
1963a5
1963a5
from pyrpkg.lookaside import CGILookasideCache
1963a5
1963a5
1963a5
class CentOSLookasideCache(CGILookasideCache):
1963a5
    """
1963a5
    Centos pkg cache rpkg subclass.
1963a5
    """
1963a5
    def __init__(self, *args, **kwargs):
1963a5
        super(CentOSLookasideCache, self).__init__(*args, **kwargs)
1963a5
        self.download_path = ('%(name)s/%(branch)s/%(hash)s')