summaryrefslogtreecommitdiffstats
path: root/files/hotfix
diff options
context:
space:
mode:
authorPatrick Uiterwijk <puiterwijk@redhat.com>2015-10-20 02:14:05 +0000
committerPatrick Uiterwijk <puiterwijk@redhat.com>2015-10-20 02:14:05 +0000
commitae66c3f1ce2935ef860f043e19591f7b8c2c8ead (patch)
tree4b0189ad34d78b73c64bfea2908ba298d6f7af68 /files/hotfix
parent738e67c90c6abfdf5030f894c7ef8950ee42c8ae (diff)
downloadansible-ae66c3f1ce2935ef860f043e19591f7b8c2c8ead.tar.gz
ansible-ae66c3f1ce2935ef860f043e19591f7b8c2c8ead.tar.xz
ansible-ae66c3f1ce2935ef860f043e19591f7b8c2c8ead.zip
Revert "mirrorlist: Use a thread-local copy of the tree to prevent changing the global one"
This reverts commit 738e67c90c6abfdf5030f894c7ef8950ee42c8ae.
Diffstat (limited to 'files/hotfix')
-rwxr-xr-xfiles/hotfix/mirrorlist/mirrorlist_server.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/files/hotfix/mirrorlist/mirrorlist_server.py b/files/hotfix/mirrorlist/mirrorlist_server.py
index b8842295a..39dfc7a78 100755
--- a/files/hotfix/mirrorlist/mirrorlist_server.py
+++ b/files/hotfix/mirrorlist/mirrorlist_server.py
@@ -6,7 +6,6 @@
# standard library modules in alphabetical order
from collections import defaultdict
-import copy
import datetime
import getopt
import logging
@@ -235,12 +234,11 @@ def tree_lookup(tree, ip, field, maxResults=None):
# and we'll get a new copy of the tree from our parent the next time it
# fork()s.
# returns a list of tuples (prefix, data)
- ltree = copy.deepcopy(tree)
result = []
len_data = 0
if ip is None:
return result
- node = ltree.search_best(ip.strNormal())
+ node = tree.search_best(ip.strNormal())
while node is not None:
prefix = node.prefix
if type(node.data[field]) == list:
@@ -250,8 +248,8 @@ def tree_lookup(tree, ip, field, maxResults=None):
t = (prefix, node.data[field],)
result.append(t)
if maxResults is None or len_data < maxResults:
- ltree.delete(prefix)
- node = ltree.search_best(ip.strNormal())
+ tree.delete(prefix)
+ node = tree.search_best(ip.strNormal())
else:
break
return result