Merge lp:~corey.bryant/charm-helpers/proxy-none into lp:charm-helpers

Proposed by Corey Bryant
Status: Merged
Merged at revision: 392
Proposed branch: lp:~corey.bryant/charm-helpers/proxy-none
Merge into: lp:charm-helpers
Diff against target: 11 lines (+2/-0)
1 file modified
charmhelpers/contrib/python/packages.py (+2/-0)
To merge this branch: bzr merge lp:~corey.bryant/charm-helpers/proxy-none
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+262885@code.launchpad.net

Description of the change

pip install --proxy=None ... will fail due to: MissingSchema: Proxy URLs must have explicit schemes.

This allows pip_install(proxy=None) to be specified and --proxy won't be passed to pip_execute. Any arbitrary keyword options will be ignored if their value is null.

To post a comment you must log in.
Revision history for this message
Mike McCracken (mikemc) wrote :

Should this check be for all the keys? are any of the keys expecting "--foo=None" ?

Revision history for this message
Corey Bryant (corey.bryant) wrote :

I think it might as well check for a blanket none on each parm. I'll update it.

393. By Corey Bryant

Drop any arbitrary keyword options that have null value.

Revision history for this message
Mike McCracken (mikemc) wrote :

LGTM

Revision history for this message
Liam Young (gnuoy) wrote :

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/python/packages.py'
2--- charmhelpers/contrib/python/packages.py 2015-05-07 18:12:54 +0000
3+++ charmhelpers/contrib/python/packages.py 2015-06-24 18:48:08 +0000
4@@ -36,6 +36,8 @@
5 def parse_options(given, available):
6 """Given a set of options, check if available"""
7 for key, value in sorted(given.items()):
8+ if not value:
9+ continue
10 if key in available:
11 yield "--{0}={1}".format(key, value)
12

Subscribers

People subscribed via source and target branches