New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1443164: no_proxy matches the host name when *.redhat.com is used #1635
Conversation
python-rhsm/src/rhsm/connection.py
Outdated
|
|
||
| no_proxy = os.environ.get('no_proxy') or os.environ.get('NO_PROXY') | ||
| # Remove all leading white spaces and asterisks from items of no_proxy | ||
| no_proxy = ','.join([item.lstrip(' *') for item in no_proxy.split(',')]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to handle the case of no_proxy=None...
1bce395
to
94115a2
Compare
|
I pushed these changes to prove tests will not fail at Jenkins. I plan to add more unit tests covering new code. Please don't merge it until more unit tests are added to this PR. |
|
Bug report for Python created: http://bugs.python.org/issue30462 |
|
Created right solution: PR for Python: python/cpython#1795, but this is long term solution with uncertain outcome. |
94115a2
to
8c8540a
Compare
|
The failure of unit tests is strange. It works at my laptop: cd python-rhsm
nosetests test/unitWith following result: ...
Ran 324 tests in 0.258s
OKIsn't |
|
@jirihnidek I can reproduce the Jenkins failures on my machine. I noticed some of our tests are a little brittle. If you've modified your /etc/rhsm/rhsm.conf, it can interfere with some of the tests. Another possibility is code that didn't get checked in. |
|
I tested it at two another VMs without any failure. I will investigate it more tomorrow. |
8c8540a
to
d7e7658
Compare
* Bug fix: https://bugzilla.redhat.com/show_bug.cgi?id=1443164 * Method proxy_bypass_environment() from urllib does not support no_proxy with items containing asterisk (e.g.: *.redhat.com). Thus values in this environment variable is preprocessed and leading asterisks are stripped. * There was opened PR for urllib to address this problem in proper way: python/cpython#1795 * Fixed functional tests for python-rshm * Added two more functional tests. * Added several functional unit tests for no_proxy environment value containing asterisk. * Refactored local variables to remove possible interference with module rhsm.connection. * Try to clear following environment variables before each unit test is performed in ConnectionTests test case: - no_proxy - NO_PROXY - HTTPS_PROXY * Small tweaks of code style (too long lines).
ac45a3c
to
c3ff0b7
Compare
support no_proxy with items containing asterisk
(e.g.: *.redhat.com). Thus values in this environment variable
is preprocessed and leading asterisks are stripped.
in proper way.