File 0001-Avoid-using-GREENDNS-due-to-dnspython.patch of Package openstack-cinder
From 4a73fecb380a4ef18acfe3eb020cf0be34c7c586 Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dirk@dmllr.de>
Date: Sun, 23 Jun 2013 13:28:24 +0200
Subject: [PATCH] Avoid using GREENDNS due to dnspython
If dnspython is present in your environment then
eventlet monkeypatches socket.getaddrinfo() with an implementation
which doesn't work for IPv6. To turn this off you need to set an
environment variable before you do the import.
Resolves bug 1164822
Change-Id: I4aa3d40d0f8d0f125c3a89c4ba062ad0d13f1c55
---
cinder/tests/__init__.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Index: cinder-2014.1.dev120.gf52cb1b/cinder/tests/__init__.py
===================================================================
--- cinder-2014.1.dev120.gf52cb1b.orig/cinder/tests/__init__.py
+++ cinder-2014.1.dev120.gf52cb1b/cinder/tests/__init__.py
@@ -28,6 +28,21 @@
.. moduleauthor:: Andy Smith <andy@anarkystic.com>
"""
+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 nova/cmd/__init__ '
+ '(env var set to %s)'
+ % os.environ.get('EVENTLET_NO_GREENDNS'))
+
+os.environ['EVENTLET_NO_GREENDNS'] = 'yes'
+
import eventlet
eventlet.monkey_patch()