summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bechtold <tbechtold@suse.com>2019-01-02 20:29:27 +0100
committerThomas Bechtold <tbechtold@suse.com>2019-01-02 20:29:27 +0100
commit2a27a433d3f579c731c13ef05b89ba4943e204d5 (patch)
tree0f04ce590c8fce1c2563c6a39d007f367f0af024
parentd144bf7593241ada3982faa9fdb60279e5d7309c (diff)
Drop is_eventlet_bug105() from manila/utils.py
The function is not used anywhere. Change-Id: I9dd7aedec35c6295e764301e7f5a81a126de85df
Notes
Notes (review): Code-Review+2: Goutham Pacha Ravi <gouthampravi@gmail.com> Code-Review+2: Rodrigo Barbieri <rodrigo.barbieri2010@gmail.com> Workflow+1: Rodrigo Barbieri <rodrigo.barbieri2010@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 03 Jan 2019 12:29:59 +0000 Reviewed-on: https://review.openstack.org/628029 Project: openstack/manila Branch: refs/heads/master
-rw-r--r--manila/tests/test_utils.py20
-rw-r--r--manila/utils.py22
2 files changed, 0 insertions, 42 deletions
diff --git a/manila/tests/test_utils.py b/manila/tests/test_utils.py
index 530fb26..bd1cd23 100644
--- a/manila/tests/test_utils.py
+++ b/manila/tests/test_utils.py
@@ -15,9 +15,7 @@
15# under the License. 15# under the License.
16 16
17import datetime 17import datetime
18import errno
19import json 18import json
20import socket
21import time 19import time
22 20
23import ddt 21import ddt
@@ -75,24 +73,6 @@ class GenericUtilsTestCase(test.TestCase):
75 self.assertFalse(result) 73 self.assertFalse(result)
76 timeutils.utcnow.assert_called_once_with() 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 @ddt.data(['ssh', '-D', 'my_name@name_of_remote_computer'], 76 @ddt.data(['ssh', '-D', 'my_name@name_of_remote_computer'],
97 ['echo', '"quoted arg with space"'], 77 ['echo', '"quoted arg with space"'],
98 ['echo', "'quoted arg with space'"]) 78 ['echo', "'quoted arg with space'"])
diff --git a/manila/utils.py b/manila/utils.py
index bb417ec..7513e2e 100644
--- a/manila/utils.py
+++ b/manila/utils.py
@@ -25,7 +25,6 @@ import pyclbr
25import random 25import random
26import re 26import re
27import shutil 27import shutil
28import socket
29import sys 28import sys
30import tempfile 29import tempfile
31import time 30import time
@@ -262,27 +261,6 @@ class LazyPluggable(object):
262 return getattr(backend, key) 261 return getattr(backend, key)
263 262
264 263
265def 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
286def monkey_patch(): 264def monkey_patch():
287 """Patch decorator. 265 """Patch decorator.
288 266