From 2a27a433d3f579c731c13ef05b89ba4943e204d5 Mon Sep 17 00:00:00 2001
From: Thomas Bechtold <tbechtold@suse.com>
Date: Wed, 2 Jan 2019 20:29:27 +0100
Subject: [PATCH] Drop is_eventlet_bug105() from manila/utils.py

The function is not used anywhere.

Change-Id: I9dd7aedec35c6295e764301e7f5a81a126de85df
---
 manila/tests/test_utils.py | 20 --------------------
 manila/utils.py            | 22 ----------------------
 2 files changed, 42 deletions(-)

diff --git a/manila/tests/test_utils.py b/manila/tests/test_utils.py
index 530fb26e4b..bd1cd23777 100644
--- a/manila/tests/test_utils.py
+++ b/manila/tests/test_utils.py
@@ -15,9 +15,7 @@
 #    under the License.
 
 import datetime
-import errno
 import json
-import socket
 import time
 
 import ddt
@@ -75,24 +73,6 @@ class GenericUtilsTestCase(test.TestCase):
             self.assertFalse(result)
             timeutils.utcnow.assert_called_once_with()
 
-    def test_is_eventlet_bug105(self):
-        fake_dns = mock.Mock()
-        fake_dns.getaddrinfo.side_effect = socket.gaierror(errno.EBADF)
-        with mock.patch.dict('sys.modules', {
-                'eventlet.support.greendns': fake_dns}):
-            self.assertTrue(utils.is_eventlet_bug105())
-            self.assertTrue(fake_dns.getaddrinfo.called)
-
-    def test_is_eventlet_bug105_neg(self):
-        fake_dns = mock.Mock()
-        fake_dns.getaddrinfo.return_value = [
-            (socket.AF_INET6, socket.SOCK_STREAM, 0, '', (u'127.0.0.1', 80)),
-        ]
-        with mock.patch.dict('sys.modules', {
-                'eventlet.support.greendns': fake_dns}):
-            self.assertFalse(utils.is_eventlet_bug105())
-            fake_dns.getaddrinfo.assert_called_once_with('::1', 80)
-
     @ddt.data(['ssh', '-D', 'my_name@name_of_remote_computer'],
               ['echo', '"quoted arg with space"'],
               ['echo', "'quoted arg with space'"])
diff --git a/manila/utils.py b/manila/utils.py
index bb417ec6b5..7513e2e8d8 100644
--- a/manila/utils.py
+++ b/manila/utils.py
@@ -25,7 +25,6 @@ import pyclbr
 import random
 import re
 import shutil
-import socket
 import sys
 import tempfile
 import time
@@ -262,27 +261,6 @@ class LazyPluggable(object):
         return getattr(backend, key)
 
 
-def is_eventlet_bug105():
-    """Check if eventlet support IPv6 addresses.
-
-    See https://bitbucket.org/eventlet/eventlet/issue/105
-
-    :rtype: bool
-    """
-    try:
-        mod = sys.modules['eventlet.support.greendns']
-    except KeyError:
-        return False
-
-    try:
-        connect_data = mod.getaddrinfo('::1', 80)
-    except socket.gaierror:
-        return True
-
-    fail = [x for x in connect_data if x[0] != socket.AF_INET6]
-    return bool(fail)
-
-
 def monkey_patch():
     """Patch decorator.