Modify ↓
Ticket #712 (closed enhancement: fixed)
pkgmgr_gen.py script patch (from David Strauss)
Reported by: | solj | Owned by: | desai |
---|---|---|---|
Priority: | major | Milestone: | Bcfg2 1.0.0 Release |
Component: | bcfg2-server | Version: | 1.0 |
Keywords: | Cc: |
Description
+ url = urlparse.urljoin(repo, './repodata/repomd.xml') + + try: + opener = pkgmgr_URLopener() + file, message = opener.retrieve(url) + except: + sys.exit(); + + try: + tree = parse(file) + except IOError: + print "ERROR: Unable to parse retrieved repomd.xml." + sys.exit() + + repomd = tree.getroot() + for element in repomd: + if element.tag.endswith('data') and element.attrib['type'] == 'primary': + for property in element: + if property.tag.endswith('location'): + primaryhref = property.attrib['href'] + + url = urlparse.urljoin(repo, './' + primaryhref)
Attachments
Change History
comment:1 Changed 14 years ago by David Strauss <[email protected]…>
comment:2 Changed 14 years ago by solj
- Status changed from new to closed
- Resolution set to fixed
Added in [20817cb4d1a02769f64453356e04a73f2d8b5be5] (SVN r5419). Thanks for the patch!
Note: See
TracTickets for help on using
tickets.
This needs to replace the old "url = urlparse.urljoin(repo, './primary.tar.gz')" line, which isn't as compatible with the Yum repository spec.