Skip to content

Commit

Permalink
gensystemid now uses proxy environment variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Feb 2, 2007
1 parent b8d42cf commit 4f69163
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -3,6 +3,7 @@
- Added promoteepoch directive to disable it for older distributions (rhel2.1, rh7.3) - Added promoteepoch directive to disable it for older distributions (rhel2.1, rh7.3)
- Fixed a problem with the disabled directive (disabled = no was ignored) - Fixed a problem with the disabled directive (disabled = no was ignored)
- Cleaned up mrepo-example.conf (Gareth Armstrong) - Cleaned up mrepo-example.conf (Gareth Armstrong)
- gensystemid now uses proxy environment variables


* 0.8.4 - Sint-Jacobsplein - released 13/12/2006 * 0.8.4 - Sint-Jacobsplein - released 13/12/2006
- Renamed Yam to mrepo (Matthew Hannigan) - Renamed Yam to mrepo (Matthew Hannigan)
Expand Down
19 changes: 18 additions & 1 deletion gensystemid
@@ -1,6 +1,6 @@
#!/usr/bin/python #!/usr/bin/python


import os, sys, getopt, getpass import os, sys, getopt, getpass, urlpass


sys.path.insert(0, "/usr/share/rhn/") sys.path.insert(0, "/usr/share/rhn/")
sys.path.insert(1,"/usr/share/rhn/up2date_client") sys.path.insert(1,"/usr/share/rhn/up2date_client")
Expand Down Expand Up @@ -190,6 +190,23 @@ def main():
else: else:
cfg['logFile'] = os.path.expanduser('~/up2date.log') 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: if op.verbose >= 5:
cfg['debug'] = 10000 cfg['debug'] = 10000


Expand Down

0 comments on commit 4f69163

Please sign in to comment.