Bug 1179877 - validate_proxy_host validates the wrong thing for yum_importer.json
Summary: validate_proxy_host validates the wrong thing for yum_importer.json
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: rpm-support
Version: 2.6 Beta
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: pulp-qe-list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-07 17:33 UTC by itinfra
Modified: 2015-02-28 23:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 23:18:13 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 653 0 None None None Never

Description itinfra 2015-01-07 17:33:50 UTC
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.

Comment 1 Brian Bouterse 2015-02-28 23:18:13 UTC
Moved to https://pulp.plan.io/issues/653


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