Skip to content

Commit

Permalink
Merge "ssl_adapter.py: Properly fix order of imports"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jun 22, 2016
2 parents 30312f8 + cf6c7fa commit dd9461d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/config/common/ssl_adapter.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
""" HTTPS Transport Adapter for python-requests, that allows configuration of
SSL version"""
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# @author: Sanju Abraham, Juniper Networks, OpenContrail
from requests.adapters import HTTPAdapter
try:
from urllib3.poolmanager import PoolManager
except ImportError:
# This is required for redhat7 as it does not have
# separate urllib3 package installed
# This is required for RDO, which installs both python-requests
# and python-urllib3, but symlinks python-request's internally packaged
# urllib3 to the site installed one.
from requests.packages.urllib3.poolmanager import PoolManager
import ssl
except ImportError:
# Fallback to standard installation methods
from urllib3.poolmanager import PoolManager

class SSLAdapter(HTTPAdapter):
'''An HTTPS Transport Adapter that can be configured with SSL/TLS version.'''
'''An HTTPS Transport Adapter that can be configured with SSL/TLS
version.'''

def __init__(self, ssl_version=None, **kwargs):
self.ssl_version = ssl_version
self.poolmanager = None

super(SSLAdapter, self).__init__(**kwargs)

Expand Down

0 comments on commit dd9461d

Please sign in to comment.