Permalink
Browse files

gensystemid now uses proxy environment variables.

  • Loading branch information...
1 parent b8d42cf commit 4f691632c3eceb32a7b9b520eff43663b75ef1f1 @dagwieers committed Feb 2, 2007
Showing with 19 additions and 1 deletion.
  1. +1 −0 ChangeLog
  2. +18 −1 gensystemid
View
@@ -3,6 +3,7 @@
- Added promoteepoch directive to disable it for older distributions (rhel2.1, rh7.3)
- Fixed a problem with the disabled directive (disabled = no was ignored)
- Cleaned up mrepo-example.conf (Gareth Armstrong)
+- gensystemid now uses proxy environment variables
* 0.8.4 - Sint-Jacobsplein - released 13/12/2006
- Renamed Yam to mrepo (Matthew Hannigan)
View
@@ -1,6 +1,6 @@
#!/usr/bin/python
-import os, sys, getopt, getpass
+import os, sys, getopt, getpass, urlpass
sys.path.insert(0, "/usr/share/rhn/")
sys.path.insert(1,"/usr/share/rhn/up2date_client")
@@ -190,6 +190,23 @@ def main():
else:
cfg['logFile'] = os.path.expanduser('~/up2date.log')
+ ### Get proxy information from environment and set up2date config accordingly
+ proxy = None
+ if os.environ.has_key('http_proxy'):
+ t, proxy, t, t, t, t = urlparse.urlparse(os.environ['http_proxy'])
+ elif os.environ.has_key('https_proxy'):
+ t, proxy, t, t, t, t = urlparse.urlparse(os.environ['https_proxy'])
+ if proxy:
+ cfg['enableProxy'] = 1
+ cfg['httpProxy'] = proxy
+ info(4, 'Setting proxy to %s' % proxy)
+ ### FIXME: Implement proxy authentication
+# if proxy.username and proxy.password:
+# cfg['enableProxyAuth'] = 1
+# cfg['proxyPassword'] = proxy.password
+# cfg['proxyUser='] = proxy.username
+
+
if op.verbose >= 5:
cfg['debug'] = 10000

0 comments on commit 4f69163

Please sign in to comment.