Foreman 2.4 / Katello 4.0: Issue sync'ing repos for CentOS Stream

It still works fine for me for CentOS 8 (x4) and CentOS Stream (x4) repos.

def parse(self):
    """Parse module.yaml, if exists, to create relations between packages."""
    if self.modulemd_result:
        modulemd_index = mmdlib.ModuleIndex.new()
        # open_func = gzip.open if self.modulemd_result.url.endswith(".gz") else open

        if self.modulemd_result.url.endswith(".gz"):
            open_func = gzip.open
        elif self.modulemd_result.url.endswith(".xz"):
            open_func = lzma.open
        else:
            open_func = open

        with open_func(self.modulemd_result.path, "r") as moduleyaml:
            content = moduleyaml.read()
            module_content = content if isinstance(content, str) else content.decode()
            modulemd_index.update_from_string(module_content, True)

        self._parse_modulemd_list(modulemd_index)
        self._parse_modulemd_default_names(modulemd_index)