tests: Fix swiftclient/requests log level & Ignore py36 deprecation warnings

Gotta update now that swiftclient changed how it imports and uses
requests.

Related-Change: https://review.opendev.org/c/openstack/python-swiftclient/+/828821
Change-Id: I0e0f802fa355060f43f9e63f52897fbcf66816d2
(cherry picked from commit a5a98d7e3b)
(cherry picked from commit 7298038ed9)
This commit is contained in:
Tim Burke 2022-04-07 14:47:05 -07:00 committed by Christian Schwede
parent f56bb37f03
commit 969dcb6ee9
3 changed files with 15 additions and 2 deletions

View File

@ -81,3 +81,7 @@ warnings.filterwarnings('ignore', module='cryptography|OpenSSL', message=(
'Python 2 is no longer supported by the Python core team. '
'Support for it is now deprecated in cryptography, '
'and will be removed in a future release.'))
warnings.filterwarnings('ignore', message=(
'Python 3.6 is no longer supported by the Python core team. '
'Therefore, support for it is deprecated in cryptography '
'and will be removed in a future release.'))

View File

@ -42,6 +42,10 @@ warnings.filterwarnings('ignore', module='cryptography|OpenSSL', message=(
'Python 2 is no longer supported by the Python core team. '
'Support for it is now deprecated in cryptography, '
'and will be removed in a future release.'))
warnings.filterwarnings('ignore', message=(
'Python 3.6 is no longer supported by the Python core team. '
'Therefore, support for it is deprecated in cryptography '
'and will be removed in a future release.'))
from eventlet.green import socket

View File

@ -43,6 +43,11 @@ from test.probe.common import ReplProbeTest, get_server_number, \
from test.debug_logger import debug_logger
import mock
try:
from swiftclient.requests_compat import requests as client_requests
except ImportError:
# legacy location
from swiftclient.client import requests as client_requests
MIN_SHARD_CONTAINER_THRESHOLD = 4
MAX_SHARD_CONTAINER_THRESHOLD = 100
@ -116,8 +121,8 @@ class BaseTestContainerSharding(ReplProbeTest):
def setUp(self):
client.logger.setLevel(client.logging.WARNING)
client.requests.logging.getLogger().setLevel(
client.requests.logging.WARNING)
client_requests.logging.getLogger().setLevel(
client_requests.logging.WARNING)
super(BaseTestContainerSharding, self).setUp()
_, self.admin_token = get_auth(
PROXY_BASE_URL + '/auth/v1.0', 'admin:admin', 'admin')