""" fedora download """
from virt.qemutest.distro.core import FetchNetinst

class FetchFedoraNetinst(FetchNetinst):
    """ class for fedora server netinst iso download """

    fedora = "https://download.fedoraproject.org/pub"

    def __init__(self, mirror = None, arch = None):
        if mirror is None:
            mirror = self.fedora
        super().__init__(mirror, arch)

    def baseurl(self, release):
        if release == 'rawhide':
            subdir = 'development'
        else:
            subdir = 'releases'
        location = f'fedora/linux/{subdir}/{release}/Server/{self.arch}/os'
        return f'{self.mirror}/{location}/'
