Bug 877862 - cobbler get-loaders with HTTP_PROXY fails to download loaders and causes NameError Exception: global name 'var' is not defined
Summary: cobbler get-loaders with HTTP_PROXY fails to download loaders and causes Name...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cobbler
Version: 17
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: James C.
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-19 04:00 UTC by Ross Brattain
Modified: 2012-11-19 04:10 UTC (History)
4 users (show)

Fixed In Version: 2.4.0
Clone Of:
Environment:
Last Closed: 2012-11-19 04:10:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ross Brattain 2012-11-19 04:00:23 UTC
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):

cobbler-2.2.3-2.fc17.noarch

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]

!!! TASK FAILED !!!


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-19 04:10:29 UTC
As noted above, this has been fixed upstream and will be included in 2.4.0:

https://github.com/cobbler/cobbler/pull/341


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