def _repodata_python(self, file_name): log_debug(3, 'repodata', file_name) c_info = rhnChannel.channel_info(self.channelName) repo = repository.get_repository(c_info) output = None content_type = "application/x-gzip" if file_name == "repomd.xml": content_type = "text/xml" output = repo.get_repomd_file() elif file_name == "primary.xml.gz": output = repo.get_primary_xml_file() elif file_name == "other.xml.gz": output = repo.get_other_xml_file() elif file_name == "filelists.xml.gz": output = repo.get_filelists_xml_file() elif file_name == "updateinfo.xml.gz": output = repo.get_updateinfo_xml_file() elif file_name == "comps.xml": content_type = "text/xml" output = repo.get_comps_file() else: log_debug(2, "Unknown repomd file requested: %s" % file_name) raise rhnFault(6) output = rpclib.transports.File(output, name=file_name) rhnFlags.set('Content-Type', content_type) return output
def _repodata_python(self, file_name): log_debug(3, 'repodata', file_name) c_info = rhnChannel.channel_info(self.channelName) repo = repository.get_repository(c_info) output = None content_type = "application/x-gzip" if file_name == "repomd.xml": content_type = "text/xml" output = repo.get_repomd_file() elif file_name == "primary.xml.gz": output = repo.get_primary_xml_file() elif file_name == "other.xml.gz": output = repo.get_other_xml_file() elif file_name == "filelists.xml.gz": output = repo.get_filelists_xml_file() elif file_name == "updateinfo.xml.gz": output = repo.get_updateinfo_xml_file() elif file_name == "comps.xml": content_type = "text/xml" output = repo.get_comps_file() elif file_name == "modules.yaml": output = repo.get_modules_file() else: log_debug(2, "Unknown repomd file requested: %s" % file_name) raise rhnFault(6) output = rpclib.transports.File(output, name=file_name) rhnFlags.set('Content-Type', content_type) return output