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