from common.builddata import BuildData, BuildDataError
from common.imagedata import ImageData
from common import manifest
+import xml.etree.cElementTree as ElementTree
# arch map table:
# key->val: map the arch from 'key' to 'val' to make the url unify
'w') as manifest_fh:
manifest_fh.write(manifest_string)
+ manifest_items = []
+ try:
+ tree = ElementTree.fromstring(manifest_string)
+ for project in tree.findall('project'):
+ manifest_items.append({project.get('path'): project.get('revision')})
+ except Exception as err:
+ print repr(err)
+ return manifest_items
+
def get_rpm_vcs_from(self, rpm_file):
"""Returns rpm information by querying a rpm"""
ts = rpm.ts()
from common.backenddb import BackendDB
from common.snapshot import Snapshot, SnapshotError, snapshot_project_enabled
from common.utils import make_latest_link
+from common.send_mail import prepare_mail
class LocalError(Exception):
"""Local error exception."""
os.getenv('GERRIT_FETCH_URL'),
os.getenv('GERRIT_REVIEW_URL'),
live_repo_path, repo['Architectures'])
+ # Check duplicated items
+ path_list = [ t.keys()[0] for t in manifest_items ]
+ duplicated = set([x for x in path_list if path_list.count(x) > 1])
+ if len(duplicated) >= 1:
+ prepare_mail('error_report_manifest.env', \
+ 'Snapshot %s have duplicated packages' % (snapshot.build_id), \
+ '\nDuplicated items: %s' % duplicated, \
+ os.getenv('NOREPLY_EMAIL_SENDER'), \
+ os.getenv('MAILINGLIST_SYSTEM').split(','))
return {'project': project,
'repo': repos,