summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaku Yamahata <isaku.yamahata@intel.com>2018-04-17 06:53:45 -0700
committerIsaku Yamahata <isaku.yamahata@gmail.com>2018-04-19 15:53:29 +0000
commit2c31f7f35129cb2160592633e52083b412d6c2cd (patch)
tree59bd1135dbae21cdbf0c86099afd1e7e78630c16
parent4749941f88951ecb3bbe9fce64cf93c54b7d56d2 (diff)
eventlet v0.22 changed HttpProtocol.__init__
From eventlet v0.22, HttpProtocol.__init__ signature was changed to take 4 argument to 3 argument. The changeset of eventlet, 7f53465578543156e7251e243c0636e087a8445f, https://github.com/eventlet/eventlet/issues/188 changed it. So try the new signature for HttpProtocol.__init__ first, and then fallback to the old signature for compatibility. Change-Id: I2e024f04ceab10afb20b5a402f8ba8dfd50e753d
Notes
Notes (review): Code-Review+2: Ihar Hrachyshka <ihrachys@redhat.com> Code-Review+2: Slawek Kaplonski <skaplons@redhat.com> Workflow+1: Slawek Kaplonski <skaplons@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 26 Apr 2018 09:07:04 +0000 Reviewed-on: https://review.openstack.org/561953 Project: openstack/neutron Branch: refs/heads/master
-rw-r--r--neutron/agent/linux/utils.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/neutron/agent/linux/utils.py b/neutron/agent/linux/utils.py
index 7dc8489..356a304 100644
--- a/neutron/agent/linux/utils.py
+++ b/neutron/agent/linux/utils.py
@@ -390,9 +390,21 @@ class UnixDomainHttpProtocol(eventlet.wsgi.HttpProtocol):
390 def __init__(self, request, client_address, server): 390 def __init__(self, request, client_address, server):
391 if not client_address: 391 if not client_address:
392 client_address = ('<local>', 0) 392 client_address = ('<local>', 0)
393 # base class is old-style, so super does not work properly 393
394 eventlet.wsgi.HttpProtocol.__init__(self, request, client_address, 394 # NOTE(yamahata): from eventlet v0.22 HttpProtocol.__init__
395 server) 395 # signature was changed by changeset of
396 # 7f53465578543156e7251e243c0636e087a8445f
397 # try the new signature first, and then fallback to the old
398 # signature for compatibility
399 try:
400 conn_state = [client_address, request, eventlet.wsgi.STATE_CLOSE]
401 # base class is old-style, so super does not work properly
402 eventlet.wsgi.HttpProtocol.__init__(self, conn_state, server)
403 except (AttributeError, TypeError):
404 # AttributeError: missing STATE_CLOSE
405 # TypeError: signature mismatch
406 eventlet.wsgi.HttpProtocol.__init__(
407 self, request, client_address, server)
396 408
397 409
398class UnixDomainWSGIServer(wsgi.Server): 410class UnixDomainWSGIServer(wsgi.Server):