def parse_metadata(self, metadata_xml):
        """
        Parse repomd.xml file

        :type metadata_xml: str
        :param metadata_xml: raw xml representation of repomd.xml
        """
        try:
            metadata = dict()
            mdata = xmltodict.parse(metadata_xml)['metadata']
            metadata['revision'] = mdata['revision']
            metadata['manifests'] = dict()

            # check if multiple manifests are present
            if type(mdata['data']) is list:
                manifests = mdata['data']
            else:
                manifests = [mdata['data']]

            for manifest in manifests:
                manifest_dict = dict()
                manifest_dict['type'] = manifest['@type']
                manifest_dict['checksum'] = manifest['checksum']
                manifest_dict['open_checksum'] = manifest['open_checksum']
                manifest_dict['location'] = manifest['location']['@href']
                manifest_dict['timestamp'] = datetime.fromtimestamp(
                                                 int(manifest['timestamp']))
                manifest_dict['size'] = int(manifest['size'])
                manifest_dict['open_size'] = int(manifest['open_size'])
                metadata['manifests'][manifest['@type']] = manifest_dict

        except Exception as e:
            raise RepositoryError("{0}/{1}".format(self.url,self.metadata_dir,
                                                   self.metadata_file), e)

        return metadata
Parse repomd.xml file

        :type metadata_xml: str
        :param metadata_xml: raw xml representation of repomd.xml