Revert "Disable eventlet monkey-patching of DNS"

This reverts commit 6219f94b3a.

This commit seems to cause keystone auth to hang when using
Keystone w/ Swift.

Fixes LP Bug #1178646.

Change-Id: Ieb94a29b3129847c84a02c8a526611f125f21ea0
This commit is contained in:
Dan Prince 2013-05-10 07:47:13 -04:00
parent 46b224abf1
commit d6dc64c43f
3 changed files with 7 additions and 33 deletions

View File

@ -2,25 +2,12 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
import greenlet
import eventlet
import logging
import os
import signal
import sys
# NOTE(mikal): All of this is because if dnspython is present in your
# environment then eventlet monkeypatches socket.getaddrinfo() with an
# implementation which doesn't work for IPv6. What we're checking here is
# that the magic environment variable was set when the import happened.
if ('eventlet' in sys.modules and
os.environ.get('EVENTLET_NO_GREENDNS', '').lower() != 'yes'):
raise ImportError('eventlet imported before keystone-all '
'(env var set to %s)'
% os.environ.get('EVENTLET_NO_GREENDNS'))
os.environ['EVENTLET_NO_GREENDNS'] = 'yes'
import eventlet
# If ../keystone/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(__file__),

View File

@ -1,15 +0,0 @@
import os
import sys
# NOTE(mikal): All of this is because if dnspython is present in your
# environment then eventlet monkeypatches socket.getaddrinfo() with an
# implementation which doesn't work for IPv6. What we're checking here is
# that the magic environment variable was set when the import happened.
if ('eventlet' in sys.modules and os.environ.get(
'EVENTLET_NO_GREENDNS', '').lower() != 'yes'):
raise ImportError('eventlet imported before keystone '
'(env var set to %s)'
% os.environ.get('EVENTLET_NO_GREENDNS'))
os.environ['EVENTLET_NO_GREENDNS'] = 'yes'

View File

@ -14,14 +14,12 @@
# License for the specific language governing permissions and limitations
# under the License.
import os
import sys
import datetime
import errno
import os
import socket
import subprocess
import sys
import time
import eventlet
@ -353,6 +351,10 @@ class TestCase(NoModule, unittest.TestCase):
@staticmethod
def skip_if_no_ipv6():
# TODO(blk-u): lp 1176204. At this time, eventlet address resolution
# doesn't support IPv6. Once it does, remove the next line.
raise nose.exc.SkipTest("Eventlet doesn't support IPv6, lp 1176204")
try:
s = socket.socket(socket.AF_INET6)
except socket.error as e: