Python3 eventlet patched httplib _MAXHEADERS

This change patches the correct eventlet monkey patched httplib's
_MAXHEADERS as required by Swift.

It also makes the configparser inside the copy middleware py3
compatable.

Change-Id: I2f7dbcecbbecd7cb69b7031faa39f35bcfadcfc8
This commit is contained in:
Lokesh S 2016-07-20 13:49:29 +00:00 committed by Matthew Oliver
parent d9b765320d
commit 26d91f2b10
3 changed files with 8 additions and 3 deletions

View File

@ -38,7 +38,10 @@ from eventlet.green.httplib import CONTINUE, HTTPConnection, HTTPMessage, \
from six.moves.urllib.parse import quote from six.moves.urllib.parse import quote
import six import six
httplib = eventlet.import_patched('httplib') if six.PY2:
httplib = eventlet.import_patched('httplib')
else:
httplib = eventlet.import_patched('http.client')
httplib._MAXHEADERS = constraints.MAX_HEADER_COUNT httplib._MAXHEADERS = constraints.MAX_HEADER_COUNT

View File

@ -132,7 +132,7 @@ backwards compatibility. At first chance, set ``object_post_as_copy`` to
""" """
import os import os
from ConfigParser import ConfigParser, NoSectionError, NoOptionError from six.moves.configparser import ConfigParser, NoSectionError, NoOptionError
from six.moves.urllib.parse import quote, unquote from six.moves.urllib.parse import quote, unquote
from swift.common import utils from swift.common import utils

View File

@ -15,9 +15,11 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import httplib
import random import random
from six.moves import http_client as httplib
from swift.common.storage_policy import POLICIES from swift.common.storage_policy import POLICIES
from swift.common.ring import Ring from swift.common.ring import Ring
from swift.common.manager import Manager from swift.common.manager import Manager