Hello community, here is the log from the commit of package python-redfish for openSUSE:Factory checked in at 2020-06-14 18:33:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-redfish (Old) and /work/SRC/openSUSE:Factory/.python-redfish.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-redfish" Sun Jun 14 18:33:01 2020 rev:3 rq:814304 version:2.1.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-redfish/python-redfish.changes 2020-03-19 19:53:57.696276965 +0100 +++ /work/SRC/openSUSE:Factory/.python-redfish.new.3606/python-redfish.changes 2020-06-14 18:35:36.122597958 +0200 @@ -1,0 +2,7 @@ +Sat Jun 13 11:56:01 UTC 2020 - Martin Hauke <[email protected]> + +- Update to version 2.1.6 + * Added support for leveraging the 'HTTP_PROXY' and 'HTTPS_PROXY' + environment variables to set up proxy information + +------------------------------------------------------------------- Old: ---- redfish-2.1.5.tar.gz New: ---- redfish-2.1.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-redfish.spec ++++++ --- /var/tmp/diff_new_pack.dAys07/_old 2020-06-14 18:35:37.022600824 +0200 +++ /var/tmp/diff_new_pack.dAys07/_new 2020-06-14 18:35:37.026600837 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-redfish -Version: 2.1.5 +Version: 2.1.6 Release: 0 Summary: Redfish Python Library License: BSD-3-Clause ++++++ redfish-2.1.5.tar.gz -> redfish-2.1.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-redfish-library-2.1.5/.gitignore new/python-redfish-library-2.1.6/.gitignore --- old/python-redfish-library-2.1.5/.gitignore 2020-02-03 21:18:29.000000000 +0100 +++ new/python-redfish-library-2.1.6/.gitignore 2020-06-12 19:20:17.000000000 +0200 @@ -30,6 +30,9 @@ *.manifest *.spec +# pyenv +.python-version + # Installer logs pip-log.txt pip-delete-this-directory.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-redfish-library-2.1.5/CHANGELOG.md new/python-redfish-library-2.1.6/CHANGELOG.md --- old/python-redfish-library-2.1.5/CHANGELOG.md 2020-02-03 21:18:29.000000000 +0100 +++ new/python-redfish-library-2.1.6/CHANGELOG.md 2020-06-12 19:20:17.000000000 +0200 @@ -1,5 +1,8 @@ # Change Log +## [2.1.6] - 2020-06-12 +- Added support for leveraging the 'HTTP_PROXY' and 'HTTPS_PROXY' environment variables to set up proxy information + ## [2.1.5] - 2020-02-03 - Removed urlparse2 dependency - Updated jsonpatch requirements; jsonpatch 1.25 dropped Python 3.4 support diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-redfish-library-2.1.5/README.rst new/python-redfish-library-2.1.6/README.rst --- old/python-redfish-library-2.1.5/README.rst 2020-02-03 21:18:29.000000000 +0100 +++ new/python-redfish-library-2.1.6/README.rst 2020-06-12 19:20:17.000000000 +0200 @@ -145,6 +145,15 @@ A logout deletes the current sesssion from the system. The redfish_client object destructor includes a logout statement. +Using proxies +~~~~~~~~~~~~~ + +You can use a proxy by specifying the ``HTTP_PROXY`` and ``HTTPS_PROXY`` environment variables. + +.. code-block:: shell + + export HTTP_PROXY="http://192.168.1.10:8888" + export HTTPS_PROXY="http://192.168.1.10:8888" Contributing ------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-redfish-library-2.1.5/setup.py new/python-redfish-library-2.1.6/setup.py --- old/python-redfish-library-2.1.5/setup.py 2020-02-03 21:18:29.000000000 +0100 +++ new/python-redfish-library-2.1.6/setup.py 2020-06-12 19:20:17.000000000 +0200 @@ -7,7 +7,7 @@ long_description = f.read() setup(name='redfish', - version='2.1.5', + version='2.1.6', description='Redfish Python Library', long_description=long_description, long_description_content_type='text/x-rst', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-redfish-library-2.1.5/src/redfish/__init__.py new/python-redfish-library-2.1.6/src/redfish/__init__.py --- old/python-redfish-library-2.1.5/src/redfish/__init__.py 2020-02-03 21:18:29.000000000 +0100 +++ new/python-redfish-library-2.1.6/src/redfish/__init__.py 2020-06-12 19:20:17.000000000 +0200 @@ -5,7 +5,7 @@ """ Redfish restful library """ __all__ = ['rest', 'ris', 'discovery'] -__version__ = "2.1.5" +__version__ = "2.1.6" from redfish.rest.v1 import redfish_client from redfish.rest.v1 import AuthMethod diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-redfish-library-2.1.5/src/redfish/rest/v1.py new/python-redfish-library-2.1.6/src/redfish/rest/v1.py --- old/python-redfish-library-2.1.5/src/redfish/rest/v1.py 2020-02-03 21:18:29.000000000 +0100 +++ new/python-redfish-library-2.1.6/src/redfish/rest/v1.py 2020-06-12 19:20:17.000000000 +0200 @@ -7,6 +7,7 @@ #---------Imports--------- +import os import sys import ssl import time @@ -455,6 +456,39 @@ self.get_root_object() self.__destroy_connection() + @staticmethod + def _get_connection(url, **kwargs): + """ + Wrapper function for the HTTPSConnection/HTTPConnection constructor + that handles proxies set by the HTTPS_PROXY and HTTP_PROXY environment + variables + + :param url: the target URL + :param kwargs: keyword arguments for the connection constructor + :return: the connection + """ + proxy = None + if url.scheme.upper() == "HTTPS": + connection = http_client.HTTPSConnection + if 'HTTPS_PROXY' in os.environ: + host = urlparse(os.environ['HTTPS_PROXY']).netloc + proxy = url.netloc + else: + host = url.netloc + else: + connection = http_client.HTTPConnection + if 'HTTP_PROXY' in os.environ: + host = urlparse(os.environ['HTTP_PROXY']).netloc + proxy = url.netloc + else: + host = url.netloc + conn = connection(host, **kwargs) + if proxy: + LOGGER.debug("Proxy %s connection to %s through %s" % ( + url.scheme.upper(), proxy, host)) + conn.set_tunnel(proxy) + return conn + def __init_connection(self, url=None): """Function for initiating connection with remote server @@ -467,20 +501,18 @@ url = url if url else self.__url if url.scheme.upper() == "HTTPS": if sys.version_info < (2, 7, 9) and "context" not in inspect.getargspec(http_client.HTTPSConnection.__init__).args: - self._conn = http_client.HTTPSConnection(url.netloc, - timeout=self._timeout) + self._conn = self._get_connection(url, timeout=self._timeout) else: if self.cafile or self.capath is not None: ssl_context = ssl.create_default_context( capath=self.capath, cafile=self.cafile) else: ssl_context = ssl._create_unverified_context() - self._conn = http_client.HTTPSConnection(url.netloc, - context=ssl_context, - timeout=self._timeout) + self._conn = self._get_connection(url, + context=ssl_context, + timeout=self._timeout) elif url.scheme.upper() == "HTTP": - self._conn = http_client.HTTPConnection(url.netloc, - timeout=self._timeout) + self._conn = self._get_connection(url, timeout=self._timeout) else: pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-redfish-library-2.1.5/tox.ini new/python-redfish-library-2.1.6/tox.ini --- old/python-redfish-library-2.1.5/tox.ini 2020-02-03 21:18:29.000000000 +0100 +++ new/python-redfish-library-2.1.6/tox.ini 2020-06-12 19:20:17.000000000 +0200 @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36,py37 +envlist = py27,py34,py35,py36,py37,py38 [testenv] usedevelop = True @@ -22,6 +22,14 @@ nose nose-timer +[testenv:py34] +deps = + coverage + fixtures + nose + nose-timer + testtools >= 0.9.22, <= 2.3.0 + [testenv:pep8] basepython = python3.6 deps = flake8
