Issue #653
closedvalidate_proxy_host validates the wrong thing for yum_importer.json
Description
Description of problem:
the config validation for yum_importer.json requires that proxy_host be set if proxy_port is defined. nectar however doesn't use proxy_host, it uses proxy_url instead. The validation therefore requires an extra, unused config parameter to be specified.
Version-Release number of selected component (if applicable):
2.6-beta1
How reproducible:
Always
Steps to Reproduce:
1. Edit yum_importer.json, define proxy_url and proxy_port
2. Reload httpd
3. Run any pulp-admin command, e.g. pulp-admin rpm repo list
Actual results:
The server indicated one or more values were incorrect. The server provided the
following error message:
Configuration errors:
The configuration parameter <proxy_host> is required
when any of the following other parameters are defined: proxy_password,
proxy_port, proxy_username.
More information can be found in the client log file ~/.pulp/admin.log.
The requested action is not completed because of this error.
Expected results:
The validator should require proxy_url be defined, not proxy_host.
Additional info:
If one follows the advise of the validator and defines proxy_host and proxy_port only then rpm sync operations fail due to a string manipulation error:
pulp: nectar.downloaders.threaded:ERROR: (20615-56256) File "/usr/lib/python2.6/site-packages/nectar/downloaders/threaded.py", line 342, in _add_proxy
pulp: nectar.downloaders.threaded:ERROR: (20615-56256) url = ':'.join((host, str(config.proxy_port)))
pulp: nectar.downloaders.threaded:ERROR: (20615-56256) TypeError: sequence item 0: expected string, NoneType found
I've filed this under rpm-support as that's where I've run into the bug but given the validator is in pulp core I suspect this will affect multiple features. I'm not familiar enough with the codebase to pick a more appropriate product, please feel free to update as needed.
+ This bug was cloned from Bugzilla Bug #1179877 +
Merge pull request #653 from asmacdo/fix-21migration-pep8
fix pep8 errors that cause problems on merge forward