Bug 877862 - cobbler get-loaders with HTTP_PROXY fails to download loaders and causes NameError Exception: global name 'var' is not defined
cobbler get-loaders with HTTP_PROXY fails to download loaders and causes Name...
Product: Fedora
Classification: Fedora
Component: cobbler (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: James C.
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-11-18 23:00 EST by Ross Brattain
Modified: 2012-11-18 23:10 EST (History)
4 users (show)

See Also:
Fixed In Version: 2.4.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-11-18 23:10:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ross Brattain 2012-11-18 23:00:23 EST
Description of problem:

When HTTP_PROXY is defined cobbler get-loaders fails and triggers a NameError exception.

cobbler/action_dlcontent.py is missing some code from upstream and uses an undefined variable 'var' on line 67:

proxies['http'] = os.environ[var]

This should be:
proxies['http'] = os.environ["HTTP_PROXY"]

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1. export HTTP_PROXY=http://localhost:911
2. cobblerd -F
3. cobbler get-loaders
Actual results:

task started: 2012-11-18_191845_get_loaders
task started (id=Download Bootloader Content, time=Sun Nov 18 19:18:45 2012)
Exception occured: <type 'exceptions.NameError'>
Exception value: global name 'var' is not defined
Exception Info:
  File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 89, in run
    rc = self._run(self)
   File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 183, in runner
    return self.remote.api.dlcontent(self.options.get("force",False), self.logger)
   File "/usr/lib/python2.7/site-packages/cobbler/api.py", line 689, in dlcontent
    return grabber.run(force)
   File "/usr/lib/python2.7/site-packages/cobbler/action_dlcontent.py", line 67, in run
    proxies['http'] = os.environ[var]


Expected results:

Downloads successful.

Additional info:

Workaround is replace action_dlcontent.py with upstream from github, then download works.
Comment 1 James C. 2012-11-18 23:10:29 EST
As noted above, this has been fixed upstream and will be included in 2.4.0:


Note You need to log in before you can comment on or make changes to this bug.