Browse Source

Drop is_eventlet_bug105() from manila/utils.py

The function is not used anywhere.

Change-Id: I9dd7aedec35c6295e764301e7f5a81a126de85df
Thomas Bechtold 3 months ago
parent
commit
2a27a433d3
2 changed files with 0 additions and 42 deletions
  1. 0
    20
      manila/tests/test_utils.py
  2. 0
    22
      manila/utils.py

+ 0
- 20
manila/tests/test_utils.py View File

@@ -15,9 +15,7 @@
15 15
 #    under the License.
16 16
 
17 17
 import datetime
18
-import errno
19 18
 import json
20
-import socket
21 19
 import time
22 20
 
23 21
 import ddt
@@ -75,24 +73,6 @@ class GenericUtilsTestCase(test.TestCase):
75 73
             self.assertFalse(result)
76 74
             timeutils.utcnow.assert_called_once_with()
77 75
 
78
-    def test_is_eventlet_bug105(self):
79
-        fake_dns = mock.Mock()
80
-        fake_dns.getaddrinfo.side_effect = socket.gaierror(errno.EBADF)
81
-        with mock.patch.dict('sys.modules', {
82
-                'eventlet.support.greendns': fake_dns}):
83
-            self.assertTrue(utils.is_eventlet_bug105())
84
-            self.assertTrue(fake_dns.getaddrinfo.called)
85
-
86
-    def test_is_eventlet_bug105_neg(self):
87
-        fake_dns = mock.Mock()
88
-        fake_dns.getaddrinfo.return_value = [
89
-            (socket.AF_INET6, socket.SOCK_STREAM, 0, '', (u'127.0.0.1', 80)),
90
-        ]
91
-        with mock.patch.dict('sys.modules', {
92
-                'eventlet.support.greendns': fake_dns}):
93
-            self.assertFalse(utils.is_eventlet_bug105())
94
-            fake_dns.getaddrinfo.assert_called_once_with('::1', 80)
95
-
96 76
     @ddt.data(['ssh', '-D', 'my_name@name_of_remote_computer'],
97 77
               ['echo', '"quoted arg with space"'],
98 78
               ['echo', "'quoted arg with space'"])

+ 0
- 22
manila/utils.py View File

@@ -25,7 +25,6 @@ import pyclbr
25 25
 import random
26 26
 import re
27 27
 import shutil
28
-import socket
29 28
 import sys
30 29
 import tempfile
31 30
 import time
@@ -262,27 +261,6 @@ class LazyPluggable(object):
262 261
         return getattr(backend, key)
263 262
 
264 263
 
265
-def is_eventlet_bug105():
266
-    """Check if eventlet support IPv6 addresses.
267
-
268
-    See https://bitbucket.org/eventlet/eventlet/issue/105
269
-
270
-    :rtype: bool
271
-    """
272
-    try:
273
-        mod = sys.modules['eventlet.support.greendns']
274
-    except KeyError:
275
-        return False
276
-
277
-    try:
278
-        connect_data = mod.getaddrinfo('::1', 80)
279
-    except socket.gaierror:
280
-        return True
281
-
282
-    fail = [x for x in connect_data if x[0] != socket.AF_INET6]
283
-    return bool(fail)
284
-
285
-
286 264
 def monkey_patch():
287 265
     """Patch decorator.
288 266
 

Loading…
Cancel
Save