Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 850a4ad

Browse files
committed
Use urllib3 directly instead of requests.packages.urllib3
fixes mypy error: Module has no attribute "urllib3". Import urllib3 directly to fix type checking after change I59f76d7c36af198b414114357cdc734b64d74b17 removed the type ignore comment. Change-Id: I3404f866543813a43301dc3f2ca8a7e6172e7c79 Signed-off-by: Amit Uniyal <[email protected]>
1 parent 2ef4fad commit 850a4ad

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cinder/volume/manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
from oslo_utils import uuidutils
5656
from oslo_versionedobjects import fields as ovo_fields
5757
profiler = importutils.try_import('osprofiler.profiler')
58-
import requests
5958
from taskflow import exceptions as tfe
59+
import urllib3
6060

6161
from cinder.backup import rpcapi as backup_rpcapi
6262
from cinder.common import constants
@@ -304,9 +304,9 @@ def __init__(self, volume_driver=None, service_name: Optional[str] = None,
304304

305305
if self.configuration.suppress_requests_ssl_warnings:
306306
LOG.warning("Suppressing requests library SSL Warnings")
307-
rpu = requests.packages.urllib3
308-
rpu.disable_warnings(rpu.exceptions.InsecureRequestWarning)
309-
rpu.disable_warnings(rpu.exceptions.InsecurePlatformWarning)
307+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
308+
urllib3.disable_warnings(
309+
urllib3.exceptions.InsecurePlatformWarning)
310310

311311
self.key_manager = key_manager.API(CONF)
312312
self.driver = importutils.import_object(

0 commit comments

Comments
 (0)