From 1acb23f8d64ce95ee8133fec26598d3b7345b756 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 31 Aug 2016 17:16:01 +0200 Subject: [PATCH] Fix uri to run on python3 (#4580) Since dict no longer have a method iteritems, we have to use the six wrapper. --- network/basics/uri.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network/basics/uri.py b/network/basics/uri.py index 844761c38bd..e42bb068e64 100644 --- a/network/basics/uri.py +++ b/network/basics/uri.py @@ -391,7 +391,7 @@ def main(): # Grab all the http headers. Need this hack since passing multi-values is # currently a bit ugly. (e.g. headers='{"Content-Type":"application/json"}') - for key, value in module.params.iteritems(): + for key, value in six.iteritems(module.params): if key.startswith("HEADER_"): skey = key.replace("HEADER_", "") dict_headers[skey] = value @@ -435,7 +435,7 @@ def main(): # Transmogrify the headers, replacing '-' with '_', since variables dont # work with dashes. uresp = {} - for key, value in resp.iteritems(): + for key, value in six.iteritems(resp): ukey = key.replace("-", "_") uresp[ukey] = value