Modify

Ticket #712 (closed enhancement: fixed)

Opened 14 years ago

Last modified 14 years ago

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]…>

This needs to replace the old "url = urlparse.urljoin(repo, './primary.tar.gz')" line, which isn't as compatible with the Yum repository spec.

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!

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.