~avishai-ish-shalom/cloud-init/chef-refactor

« back to all changes in this revision

Viewing changes to cloudinit/url_helper.py

  • Committer: Joshua Harlow
  • Date: 2013-05-13 21:47:48 UTC
  • mfrom: (812.1.1 fix-d)
  • Revision ID: harlowja@yahoo-inc.com-20130513214748-mmf9s4o2ggnc6bxe
Fix how python 2.6 was broken due to new dict syntax.

Said syntax doesn't exist in RHEL since it is new to 2.7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
    for i in range(0, manual_tries):
166
166
        try:
167
167
            req_args['headers'] = headers_cb(url)
 
168
            filtered_req_args = {}
 
169
            for (k, v) in req_args.items():
 
170
                if k == 'data':
 
171
                    continue
 
172
                filtered_req_args[k] = v
 
173
 
168
174
            LOG.debug("[%s/%s] open '%s' with %s configuration", i,
169
 
                      manual_tries, url,
170
 
                      {k: req_args[k] for k in req_args if k != 'data'})
 
175
                      manual_tries, url, filtered_req_args)
171
176
 
172
177
            r = requests.request(**req_args)
173
178
            if check_status: