This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 965764 - [RFE] The DownloadConfig should raise an Exception if an unsupported config key is passed to it
[RFE] The DownloadConfig should raise an Exception if an unsupported config k...
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: z_other (Show other bugs)
Master
Unspecified Unspecified
medium Severity unspecified
: ---
: 2.4.0
Assigned To: Randy Barlow
Preethi Thomas
: FutureFeature, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-21 12:46 EDT by Randy Barlow
Modified: 2014-08-09 02:55 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-09 02:55:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Randy Barlow 2013-05-21 12:46:36 EDT
I just encountered a bug where I was passing in "num_threads" instead of "max_concurrent" to the DownloadConfig, and the concurrency wasn't working. Obviously that was my mistake, but it would have saved me a lot of time if I had gotten an error about it.
Comment 2 Jeff Ortel 2014-04-03 09:36:27 EDT
build: 2.4.0-0.7.beta
Comment 3 Randy Barlow 2014-06-26 09:28:11 EDT
Preethi, I don't believe this bug can be easily validated by using Pulp as it is requesting an internal API change. You could ask another developer to review it and put a stamp of approval. Another option is to try to do what this bug is about in a Python shell:

rbarlow@guava ~/d/p/nectar> python
Python 2.7.6 (default, May 27 2014, 16:39:58) 
[GCC 4.9.0 20140518 (Red Hat 4.9.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from nectar.config import DownloadConfig
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name DownloadConfig
>>> from nectar.config import DownloaderConfig
>>> a = DownloaderConfig(max_concurrent=5)
>>> b = DownloaderConfig(unsupported_option=5)
Exception AttributeError: "'DownloaderConfig' object has no attribute '_temp_files'" in <bound method DownloaderConfig.__del__ of <nectar.config.DownloaderConfig object at 0x209d310>> ignored
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'unsupported_option'
>>>

In the past, it wouldn't have raised that TypeError when an unsupported option was passed to it.
Comment 4 Preethi Thomas 2014-06-26 11:44:42 EDT
verified

[root@mgmt5 ~]# rpm -qa pulp-server
pulp-server-2.4.0-0.23.beta.el6.noarch
[root@mgmt5 ~]# 

[root@mgmt5 ~]# python
Python 2.6.6 (r266:84292, Sep  4 2013, 07:46:00) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from nectar.config import DownloadConfig
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name DownloadConfig
>>>  from nectar.config import DownloaderConfig
  File "<stdin>", line 1
    from nectar.config import DownloaderConfig
    ^
IndentationError: unexpected indent
>>> from nectar.config import DownloaderConfig
>>> a = DownloaderConfig(max_concurrent=5)
>>> b = DownloaderConfig(unsupported_option=5)
Exception AttributeError: "'DownloaderConfig' object has no attribute '_temp_files'" in <bound method DownloaderConfig.__del__ of <nectar.config.DownloaderConfig object at 0x7fdd6c6f0690>> ignored
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'unsupported_option'
>>>
Comment 5 Randy Barlow 2014-08-09 02:55:23 EDT
This has been fixed in Pulp 2.4.0-1.

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