#597 use_old_ssl is deprecated
Merged 4 years ago by mikem. Opened 4 years ago by mikem.
mikem/koji deprecate-old-ssl  into  master

file modified
+5
@@ -2060,6 +2060,7 @@ 

          self.rsession = None

          self.new_session()

          self.opts.setdefault('timeout',  60 * 60 * 12)

+         self._old_ssl_warning = False

  

  

      def new_session(self):
@@ -2067,6 +2068,10 @@ 

          if self.rsession:

              self.rsession.close()

          if self.opts.get('use_old_ssl', False) or requests is None:

+             if not self._old_ssl_warning:

+                 # only warn once per instance

+                 self.logger.warn('The use_old_ssl option is deprecated')

+                 self._old_ssl_warning = True

              if not six.PY2:

                  raise GenericError('use_old_ssl is only supported on python2')

              import koji.compatrequests

file modified
+2
@@ -12,6 +12,7 @@ 

  import urllib

  import sys

  import ssl.SSLCommon

+ from warnings import warn

  try:

      from ssl import ssl as pyssl

  except ImportError:  # pragma: no cover
@@ -22,6 +23,7 @@ 

  

      def __init__(self):

          self.connection = None

+         warn('koji: compatrequests is deprecated', DeprecationWarning)

  

      def post(self, url, data=None, headers=None, stream=None, verify=None,

                  cert=None, timeout=None):

Warn users that this option is disappearing

Commit b27fcec fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

4 years ago