Skip to content

Commit

Permalink
[config] Follow gevent deprecated code
Browse files Browse the repository at this point in the history
New gevent release 1.3 removed old deprecated wsgi code [1] used by
config unit test framework.
As that 1.3 gevent version also break the kazoo library [2], we restrict
our unit test framework to use precedent version until kazoo fix [3]
is released.

[1] http://www.gevent.org/changelog.html#b2-2018-05-03
[2] python-zk/kazoo#505
[3] python-zk/kazoo@257b589

Closes-Bug: #1771644

Conflicts:
	src/config/api-server/requirements.txt

Change-Id: Ic3df0c9036ff9b1e063e3e6f333506af807e41cf
  • Loading branch information
Édouard Thuleau authored and Shivayogi123 committed May 24, 2018
1 parent ee8fc22 commit 0cb8a12
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/config/api-server/requirements.txt
Expand Up @@ -2,7 +2,7 @@ cfgm_common
vnc_api
sandesh
sandesh-common
gevent==1.1a2
gevent<1.3 # removed when kazoo fix released https://github.com/python-zk/kazoo/commit/257b58961f7ddd9db04d6efa070739a1b0404487
geventhttpclient==1.0a
pycassa>=1.7.2
netaddr>=0.7.5
Expand Down
4 changes: 2 additions & 2 deletions src/config/common/tests/test_common.py
Expand Up @@ -33,7 +33,7 @@
import novaclient
import novaclient.client

import gevent.wsgi
import gevent.pywsgi
import uuid
from pysandesh import sandesh_logger

Expand Down Expand Up @@ -738,7 +738,7 @@ def setUpClass(cls, extra_mocks=None, extra_config_knobs=None, db=None):
#cov_handle.start()

cfgm_common.zkclient.LOG_DIR = './'
gevent.wsgi.WSGIServer.handler_class = FakeWSGIHandler
gevent.pywsgi.WSGIServer.handler_class = FakeWSGIHandler

cls.orig_mocked_values = setup_mocks(cls.mocks + (extra_mocks or []))

Expand Down
4 changes: 2 additions & 2 deletions src/config/common/tests/test_utils.py
Expand Up @@ -3,7 +3,7 @@
#
import gevent
import gevent.queue
import gevent.wsgi
import gevent.pywsgi
import gevent.monkey
gevent.monkey.patch_all()
import os
Expand Down Expand Up @@ -59,7 +59,7 @@ def _print(cls):
print "\n"
# class FakeApiConfigLog

class FakeWSGIHandler(gevent.wsgi.WSGIHandler):
class FakeWSGIHandler(gevent.pywsgi.WSGIHandler):
logger = logging.getLogger('FakeWSGIHandler')
logger.addHandler(logging.FileHandler('api_server.log'))
def __init__(self, socket, address, server):
Expand Down

0 comments on commit 0cb8a12

Please sign in to comment.