-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Patch for cobbler to honor HTTP_PROXY and FTP_PROXY variables environment.
Thank you. - -- Marcelo Moreira de Mello RHCA RHCSS RHCVA Software Maintenance Engineer http://people.redhat.com/mdemello Mobile: +55 11 9321-0854
gpg id: 2048R/FDB110E5 gpg fingerprint: 3BE7 EF71 4DD7 6812 D309 8F18 BD42 D095 FDB1 10E5
On Fri, 31 Dec 2010 15:02:01 -0200, Marcelo Moreira de Mello mmello@redhat.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Patch for cobbler to honor HTTP_PROXY and FTP_PROXY variables environment.
I believe urllib2 or whatever yum uses respects these by default. Maybe we should look into using that instead?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello Scott,
Looking the yum source code, we can verify that for some actions, yum uses urlgrabber
$ vim yum/yumRepo.py
1548 def _getMirrorList(self): 1549 """retrieve an up2date-style mirrorlist file from our mirrorlist url, 1550 also save the file to the local repo dir and use that if cache expiry 1551 not expired 1552 1553 we also s/$ARCH/$BASEARCH/ and move along 1554 return the baseurls from the mirrorlist file 1555 """ 1556 self.mirrorlist_file = self.cachedir + '/' + 'mirrorlist.txt' 1557 fo = None 1558 1559 cacheok = False 1560 if self.withinCacheAge(self.mirrorlist_file, self.mirrorlist_expire): 1561 cacheok = True 1562 fo = open(self.mirrorlist_file, 'r') 1563 else: 1564 url = self.mirrorlist 1565 scheme = urlparse.urlparse(url)[0] 1566 if scheme == '': 1567 url = 'file://' + url 1568 try: 1569 fo = urlgrabber.grabber.urlopen(url, proxies=self.proxy_dict) 1570 except urlgrabber.grabber.URLGrabError, e: 1571 print "Could not retrieve mirrorlist %s error was\n%s" % (url, e) 1572 fo = None 1573 1574 (returnlist, content) = self._readMirrorList(fo)
May I re-write the functionality using urllib2?
Thank you
Marcelo Moreira de Mello RHCA RHCSS RHCVA Software Maintenance Engineer http://people.redhat.com/mdemello Mobile: +55 11 9321-0854
gpg id: 2048R/FDB110E5 gpg fingerprint: 3BE7 EF71 4DD7 6812 D309 8F18 BD42 D095 FDB1 10E5
On 12/31/2010 05:23 PM, Scott Henson wrote:
On Fri, 31 Dec 2010 15:02:01 -0200, Marcelo Moreira de Mello mmello@redhat.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Patch for cobbler to honor HTTP_PROXY and FTP_PROXY variables environment.
I believe urllib2 or whatever yum uses respects these by default. Maybe we should look into using that instead?
On Fri, 31 Dec 2010 17:42:21 -0200, Marcelo Moreira de Mello mmello@redhat.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello Scott,
Looking the yum source code, we can verify that for some actions, yum uses urlgrabber
<snip>
May I re-write the functionality using urllib2?
I was thinking more along the lines of using urlgrabber. It seems to be available on the platforms that we currently support. I can think of a few other places we could make use of it. It definitely makes sense to use it.
cobbler-devel@lists.fedorahosted.org