From 8ae9105d6c09a4b653fb584462978ec505b732ad Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 3 May 2013 15:11:32 -0700 Subject: [PATCH] Fix a feature that doesn't yet exist on python 2.6 --- cloudinit/url_helper.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cloudinit/url_helper.py b/cloudinit/url_helper.py index 24ce6871..19a30409 100644 --- a/cloudinit/url_helper.py +++ b/cloudinit/url_helper.py @@ -165,9 +165,14 @@ def readurl(url, data=None, timeout=None, retries=0, sec_between=1, for i in range(0, manual_tries): try: req_args['headers'] = headers_cb(url) + filtered_req_args = {} + for (k, v) in req_args.items(): + if k == 'data': + continue + filtered_req_args[k] = v + LOG.debug("[%s/%s] open '%s' with %s configuration", i, - manual_tries, url, - {k: req_args[k] for k in req_args if k != 'data'}) + manual_tries, url, filtered_req_args) r = requests.request(**req_args) if check_status: