Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-swiftclient for openSUSE:Factory checked in at 2021-05-10 15:37:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-swiftclient (Old) and /work/SRC/openSUSE:Factory/.python-swiftclient.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-swiftclient" Mon May 10 15:37:47 2021 rev:31 rq:890008 version:3.11.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-swiftclient/python-swiftclient.changes 2020-10-26 16:19:08.255071424 +0100 +++ /work/SRC/openSUSE:Factory/.python-swiftclient.new.2988/python-swiftclient.changes 2021-05-10 15:40:00.097411618 +0200 @@ -1,0 +2,20 @@ +Sun May 2 17:22:04 UTC 2021 - cloud-de...@suse.de + +- update to version 3.11.1 + - Have `delete --all` imply `--versions` for the CLI + - Add cacert test config option + - Remove some py38 job cruft + - Include transaction ID in ClientException.__str__ + - Switch to newer openstackdocstheme and reno versions + - Add Python3 wallaby unit tests + - [goal] Migrate testing to ubuntu focal + - tests: Make test_delete_container_versions less flakey + - (Mostly) revert "Cleanup session on delete" + - Close connections created when calling module-level functions + - Make py39 voting + - Clean up some requirements + - Update master for stable/victoria + - remove unicode from code + - Drop lower-constraints testing + +------------------------------------------------------------------- Old: ---- python-swiftclient-3.10.1.tar.gz New: ---- python-swiftclient-3.11.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-swiftclient.spec ++++++ --- /var/tmp/diff_new_pack.hfVNSg/_old 2021-05-10 15:40:00.617409490 +0200 +++ /var/tmp/diff_new_pack.hfVNSg/_new 2021-05-10 15:40:00.621409474 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-swiftclient # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,13 +17,13 @@ Name: python-swiftclient -Version: 3.10.1 +Version: 3.11.1 Release: 0 Summary: OpenStack Object Storage API Client Library License: Apache-2.0 Group: Development/Languages/Python -URL: https://launchpad.net/python-swiftclient -Source0: https://files.pythonhosted.org/packages/source/p/python-swiftclient/python-swiftclient-3.10.1.tar.gz +URL: https://docs.openstack.org/python-swiftclient +Source0: https://files.pythonhosted.org/packages/source/p/python-swiftclient/python-swiftclient-3.11.1.tar.gz BuildRequires: openstack-macros BuildRequires: python3-keystoneclient BuildRequires: python3-mock @@ -38,7 +38,6 @@ %package -n python3-swiftclient Summary: OpenStack Object Storage API Client Library -Group: Development/Languages/Python Requires: python3-requests >= 1.1.0 Requires: python3-six >= 1.9.0 %if 0%{?suse_version} @@ -64,7 +63,7 @@ This package contains documentation files for %{name}. %prep -%autosetup -p1 -n python-swiftclient-3.10.1 +%autosetup -p1 -n python-swiftclient-3.11.1 %py_req_cleanup %build ++++++ _service ++++++ --- /var/tmp/diff_new_pack.hfVNSg/_old 2021-05-10 15:40:00.653409343 +0200 +++ /var/tmp/diff_new_pack.hfVNSg/_new 2021-05-10 15:40:00.657409326 +0200 @@ -1,8 +1,8 @@ <services> <service mode="disabled" name="renderspec"> - <param name="input-template">https://opendev.org/openstack/rpm-packaging/raw/branch/stable/victoria/openstack/python-swiftclient/python-swiftclient.spec.j2</param> + <param name="input-template">https://opendev.org/openstack/rpm-packaging/raw/branch/stable/wallaby/openstack/python-swiftclient/python-swiftclient.spec.j2</param> <param name="output-name">python-swiftclient.spec</param> - <param name="requirements">https://opendev.org/openstack/python-swiftclient/raw/branch/stable/victoria/requirements.txt</param> + <param name="requirements">https://opendev.org/openstack/python-swiftclient/raw/branch/stable/wallaby/requirements.txt</param> <param name="changelog-email">cloud-de...@suse.de</param> <param name="changelog-provider">gh,openstack,python-swiftclient</param> </service> ++++++ python-swiftclient-3.10.1.tar.gz -> python-swiftclient-3.11.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/.zuul.yaml new/python-swiftclient-3.11.1/.zuul.yaml --- old/python-swiftclient-3.10.1/.zuul.yaml 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/.zuul.yaml 2021-03-10 15:57:30.000000000 +0100 @@ -23,10 +23,13 @@ vars: # Override value from parent job to use swiftclient tests zuul_work_dir: "{{ zuul.projects['opendev.org/openstack/python-swiftclient'].src_dir }}" + # swift can use different tox env names + tox_envlist: func - job: name: swiftclient-functional-py2 parent: swiftclient-functional + nodeset: openstack-single-node-bionic description: | Run functional tests of python-swiftclient under Python 2 vars: @@ -36,9 +39,8 @@ templates: - check-requirements - lib-forward-testing-python3 - - openstack-lower-constraints-jobs - openstack-python-jobs - - openstack-python3-victoria-jobs + - openstack-python3-wallaby-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 check: @@ -46,14 +48,14 @@ - swiftclient-swift-functional - swiftclient-functional - swiftclient-functional-py2 - - openstack-tox-py38: + - openstack-tox-py39: voting: true gate: jobs: - swiftclient-swift-functional - swiftclient-functional - swiftclient-functional-py2 - - openstack-tox-py38: + - openstack-tox-py39: voting: true post: jobs: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/PKG-INFO new/python-swiftclient-3.11.1/PKG-INFO --- old/python-swiftclient-3.10.1/PKG-INFO 2020-09-11 20:43:19.000000000 +0200 +++ new/python-swiftclient-3.11.1/PKG-INFO 2021-03-10 15:58:35.520748000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: python-swiftclient -Version: 3.10.1 +Version: 3.11.1 Summary: OpenStack Object Storage API Client Library Home-page: https://docs.openstack.org/python-swiftclient/latest/ Author: OpenStack @@ -71,5 +71,6 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 Provides-Extra: keystone Provides-Extra: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/doc/requirements.txt new/python-swiftclient-3.11.1/doc/requirements.txt --- old/python-swiftclient-3.10.1/doc/requirements.txt 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/doc/requirements.txt 2021-03-10 15:57:30.000000000 +0100 @@ -1,5 +1,4 @@ keystoneauth1>=3.4.0 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,<2.0.0,>=1.6.2;python_version=='2.7' # BSD -sphinx>=2.0.0,!=2.1.0;python_version>='3.4' # BSD -reno>=2.5.0 # Apache-2.0 -openstackdocstheme>=1.31.2 # Apache-2.0 +sphinx>=1.6.2,!=1.6.6,!=1.6.7,!=2.1.0,!=3.0.0 # BSD +reno>=3.1.0 # Apache-2.0 +openstackdocstheme>=2.2.1 # Apache-2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/doc/source/conf.py new/python-swiftclient-3.11.1/doc/source/conf.py --- old/python-swiftclient-3.10.1/doc/source/conf.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/doc/source/conf.py 2021-03-10 15:57:30.000000000 +0100 @@ -53,7 +53,13 @@ master_doc = 'index' # General information about the project. -copyright = u'2013-2016 OpenStack, LLC.' +copyright = '2013-2016 OpenStack, LLC.' + +# -- Options for openstackdocstheme ------------------------------------------- +openstackdocs_repo_name = 'openstack/python-swiftclient' +openstackdocs_bug_project = 'python-swiftclient' +openstackdocs_bug_tag = '' +openstackdocs_pdf_link = True # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -131,10 +137,6 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True @@ -181,8 +183,8 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]) latex_documents = [ - ('index', 'doc-python-swiftclient.tex', u'SwiftClient Documentation', - u'OpenStack, LLC.', 'manual'), + ('index', 'doc-python-swiftclient.tex', 'SwiftClient Documentation', + 'OpenStack, LLC.', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/lower-constraints.txt new/python-swiftclient-3.11.1/lower-constraints.txt --- old/python-swiftclient-3.10.1/lower-constraints.txt 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/lower-constraints.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,46 +0,0 @@ -alabaster==0.7.10 -Babel==2.3.4 -certifi==2018.1.18 -chardet==3.0.4 -coverage==4.0 -docutils==0.11 -dulwich==0.15.0 -extras==1.0.0 -fixtures==3.0.0 -flake8==2.2.4 -futures==3.0.0 -hacking==0.10.0 -idna==2.6 -imagesize==0.7.1 -iso8601==0.1.8 -Jinja2==2.10 -keystoneauth1==3.4.0 -linecache2==1.0.0 -MarkupSafe==1.0 -mccabe==0.2.1 -mock==1.2.0 -netaddr==0.7.10 -openstackdocstheme==2.0.0 -openstacksdk==0.11.0 -oslo.config==1.2.0 -pbr==2.0.0 -pep8==1.5.7 -PrettyTable==0.7.1 -pyflakes==0.8.1 -Pygments==2.2.0 -python-keystoneclient==0.7.0 -python-mimeparse==1.6.0 -python-subunit==1.0.0 -pytz==2013.6 -PyYAML==3.12 -reno==2.5.0 -requests==1.1.0 -six==1.9.0 -snowballstemmer==1.2.1 -sphinx==2.0.0 -sphinxcontrib-websupport==1.0.1 -stestr==2.0.0 -testtools==2.2.0 -traceback2==1.4.0 -unittest2==1.1.0 -urllib3==1.22 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/python_swiftclient.egg-info/PKG-INFO new/python-swiftclient-3.11.1/python_swiftclient.egg-info/PKG-INFO --- old/python-swiftclient-3.10.1/python_swiftclient.egg-info/PKG-INFO 2020-09-11 20:43:19.000000000 +0200 +++ new/python-swiftclient-3.11.1/python_swiftclient.egg-info/PKG-INFO 2021-03-10 15:58:35.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: python-swiftclient -Version: 3.10.1 +Version: 3.11.1 Summary: OpenStack Object Storage API Client Library Home-page: https://docs.openstack.org/python-swiftclient/latest/ Author: OpenStack @@ -71,5 +71,6 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 Provides-Extra: keystone Provides-Extra: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/python_swiftclient.egg-info/SOURCES.txt new/python-swiftclient-3.11.1/python_swiftclient.egg-info/SOURCES.txt --- old/python-swiftclient-3.10.1/python_swiftclient.egg-info/SOURCES.txt 2020-09-11 20:43:19.000000000 +0200 +++ new/python-swiftclient-3.11.1/python_swiftclient.egg-info/SOURCES.txt 2021-03-10 15:58:35.000000000 +0100 @@ -12,7 +12,6 @@ MANIFEST.in README.rst bindep.txt -lower-constraints.txt requirements.txt run_tests.sh setup.cfg @@ -69,6 +68,7 @@ releasenotes/source/stein.rst releasenotes/source/train.rst releasenotes/source/ussuri.rst +releasenotes/source/victoria.rst swiftclient/__init__.py swiftclient/authv1.py swiftclient/client.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/python_swiftclient.egg-info/pbr.json new/python-swiftclient-3.11.1/python_swiftclient.egg-info/pbr.json --- old/python-swiftclient-3.10.1/python_swiftclient.egg-info/pbr.json 2020-09-11 20:43:19.000000000 +0200 +++ new/python-swiftclient-3.11.1/python_swiftclient.egg-info/pbr.json 2021-03-10 15:58:35.000000000 +0100 @@ -1 +1 @@ -{"git_version": "9d8db8f", "is_release": true} \ No newline at end of file +{"git_version": "06b36ae", "is_release": true} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/python_swiftclient.egg-info/requires.txt new/python-swiftclient-3.11.1/python_swiftclient.egg-info/requires.txt --- old/python-swiftclient-3.10.1/python_swiftclient.egg-info/requires.txt 2020-09-11 20:43:19.000000000 +0200 +++ new/python-swiftclient-3.11.1/python_swiftclient.egg-info/requires.txt 2021-03-10 15:58:35.000000000 +0100 @@ -1,7 +1,7 @@ requests>=1.1.0 six>=1.9.0 -[:(python_version=='2.7' or python_version=='2.6')] +[:(python_version=='2.7')] futures>=3.0.0 [keystone] @@ -9,8 +9,13 @@ [test] coverage!=4.4,>=4.0 -hacking<1.2.0,>=1.1.0 keystoneauth1>=3.4.0 mock>=1.2.0 openstacksdk>=0.11.0 stestr!=3.0.0,>=2.0.0 + +[test:(python_version<'3.0')] +hacking<1.2.0,>=1.1.0 + +[test:(python_version>='3.0')] +hacking<3.3.0,>=3.2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/releasenotes/source/conf.py new/python-swiftclient-3.11.1/releasenotes/source/conf.py --- old/python-swiftclient-3.10.1/releasenotes/source/conf.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/releasenotes/source/conf.py 2021-03-10 15:57:30.000000000 +0100 @@ -65,7 +65,7 @@ master_doc = 'index' # General information about the project. -copyright = u'%d, OpenStack Foundation' % datetime.datetime.now().year +copyright = '%d, OpenStack Foundation' % datetime.datetime.now().year # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -138,7 +138,7 @@ # The name for this set of Sphinx documents. # "<project> v<release> documentation" by default. # -# html_title = u'swift v2.10.0' +# html_title = 'swift v2.10.0' # A shorter title for the navigation bar. Default is the same as html_title. # @@ -258,8 +258,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). # latex_documents = [ -# (master_doc, 'swift.tex', u'swift Documentation', -# u'swift', 'manual'), +# (master_doc, 'swift.tex', 'swift Documentation', +# 'swift', 'manual'), # ] # The name of an image file (relative to this directory) to place at the top of @@ -300,7 +300,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). # man_pages = [ -# (master_doc, 'swift', u'swift Documentation', +# (master_doc, 'swift', 'swift Documentation', # [author], 1) # ] @@ -315,7 +315,7 @@ # (source start file, target name, title, author, # dir menu entry, description, category) # texinfo_documents = [ -# (master_doc, 'swift', u'swift Documentation', +# (master_doc, 'swift', 'swift Documentation', # author, 'swift', 'One line description of project.', # 'Miscellaneous'), # ] @@ -339,6 +339,6 @@ locale_dirs = ['locale/'] # -- Options for openstackdocstheme ------------------------------------------- -repository_name = 'openstack/python-swiftclient' -bug_project = 'python-swiftclient' -bug_tag = '' +openstackdocs_repo_name = 'openstack/python-swiftclient' +openstackdocs_bug_project = 'python-swiftclient' +openstackdocs_bug_tag = '' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/releasenotes/source/index.rst new/python-swiftclient-3.11.1/releasenotes/source/index.rst --- old/python-swiftclient-3.10.1/releasenotes/source/index.rst 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/releasenotes/source/index.rst 2021-03-10 15:57:30.000000000 +0100 @@ -6,6 +6,7 @@ :maxdepth: 1 current + victoria ussuri train stein diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/releasenotes/source/victoria.rst new/python-swiftclient-3.11.1/releasenotes/source/victoria.rst --- old/python-swiftclient-3.10.1/releasenotes/source/victoria.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/python-swiftclient-3.11.1/releasenotes/source/victoria.rst 2021-03-10 15:57:30.000000000 +0100 @@ -0,0 +1,6 @@ +============================= +Victoria Series Release Notes +============================= + +.. release-notes:: + :branch: stable/victoria diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/requirements.txt new/python-swiftclient-3.11.1/requirements.txt --- old/python-swiftclient-3.10.1/requirements.txt 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/requirements.txt 2021-03-10 15:57:30.000000000 +0100 @@ -1,3 +1,3 @@ -futures>=3.0.0;python_version=='2.7' or python_version=='2.6' # BSD +futures>=3.0.0;python_version=='2.7' # BSD requests>=1.1.0 six>=1.9.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/setup.cfg new/python-swiftclient-3.11.1/setup.cfg --- old/python-swiftclient-3.10.1/setup.cfg 2020-09-11 20:43:19.000000000 +0200 +++ new/python-swiftclient-3.11.1/setup.cfg 2021-03-10 15:58:35.524747800 +0100 @@ -20,6 +20,7 @@ Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 [files] packages = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/swiftclient/client.py new/python-swiftclient-3.11.1/swiftclient/client.py --- old/python-swiftclient-3.10.1/swiftclient/client.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/swiftclient/client.py 2021-03-10 15:57:30.000000000 +0100 @@ -268,7 +268,7 @@ Readable and iterable object body response wrapper. """ - def __init__(self, resp, chunk_size): + def __init__(self, resp, chunk_size, conn_to_close): """ Wrap the underlying response @@ -277,9 +277,13 @@ """ self.resp = resp self.chunk_size = chunk_size + self.conn_to_close = conn_to_close def read(self, length=None): - return self.resp.read(length) + buf = self.resp.read(length) + if length != 0 and not buf: + self.close() + return buf def __iter__(self): return self @@ -295,6 +299,8 @@ def close(self): self.resp.close() + if self.conn_to_close: + self.conn_to_close.close() class _RetryBody(_ObjectBody): @@ -320,7 +326,7 @@ :param headers: an optional dictionary with additional headers to include in the request """ - super(_RetryBody, self).__init__(resp, resp_chunk_size) + super(_RetryBody, self).__init__(resp, resp_chunk_size, None) self.expected_length = int(self.resp.getheader('Content-Length')) self.conn = connection self.container = container @@ -443,15 +449,6 @@ if timeout: self.requests_args['timeout'] = timeout - def __del__(self): - """Cleanup resources other than memory""" - if self.request_session: - # The session we create must be closed to free up file descriptors - try: - self.request_session.close() - finally: - self.request_session = None - def _request(self, *arg, **kwarg): """Final wrapper before requests call, to be patched in tests""" return self.request_session.request(*arg, **kwarg) @@ -513,7 +510,7 @@ # urllib3's connection pool. This will reduce the number of # log messages seen in bug #1341777. This does not actually # close a socket. It will also prevent people from being - # mislead as to the cause of a bug as in bug #1424732. + # misled as to the cause of a bug as in bug #1424732. self.resp.close() return chunk @@ -843,8 +840,10 @@ if headers: req_headers.update(headers) + close_conn = False if not http_conn: http_conn = http_connection(url) + close_conn = True if full_listing: rv = get_account(url, token, marker, limit, prefix, end_marker, http_conn, headers=req_headers, delimiter=delimiter) @@ -874,6 +873,8 @@ conn.request(method, full_path, '', req_headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log(("%s?%s" % (url, qs), method,), {'headers': req_headers}, resp, body) @@ -900,10 +901,12 @@ be lowercase) :raises ClientException: HTTP HEAD request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url) + close_conn = True method = "HEAD" req_headers = {'X-Auth-Token': token} if service_token: @@ -914,6 +917,8 @@ conn.request(method, parsed.path, '', req_headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log((url, method,), {'headers': req_headers}, resp, body) if resp.status < 200 or resp.status >= 300: raise ClientException.from_response(resp, 'Account HEAD failed', body) @@ -939,10 +944,12 @@ :raises ClientException: HTTP POST request failed :returns: resp_headers, body """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url) + close_conn = True method = 'POST' path = parsed.path if query_string: @@ -955,6 +962,8 @@ conn.request(method, path, data, req_headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log((url, method,), {'headers': req_headers}, resp, body) store_response(resp, response_dict) @@ -996,8 +1005,10 @@ headers will be a dict and all header names will be lowercase. :raises ClientException: HTTP GET request failed """ + close_conn = False if not http_conn: http_conn = http_connection(url) + close_conn = True if full_listing: rv = get_container(url, token, container, marker, limit, prefix, delimiter, end_marker, version_marker, path=path, @@ -1046,6 +1057,8 @@ conn.request(method, '%s?%s' % (cont_path, qs), '', req_headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log(('%(url)s%(cont_path)s?%(qs)s' % {'url': url.replace(parsed.path, ''), 'cont_path': cont_path, @@ -1076,10 +1089,12 @@ be lowercase) :raises ClientException: HTTP HEAD request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url) + close_conn = True path = '%s/%s' % (parsed.path, quote(container)) method = 'HEAD' req_headers = {'X-Auth-Token': token} @@ -1090,6 +1105,8 @@ conn.request(method, path, '', req_headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log(('%s%s' % (url.replace(parsed.path, ''), path), method,), {'headers': req_headers}, resp, body) @@ -1117,10 +1134,12 @@ :param query_string: if set will be appended with '?' to generated path :raises ClientException: HTTP PUT request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url) + close_conn = True path = '%s/%s' % (parsed.path, quote(container)) method = 'PUT' req_headers = {'X-Auth-Token': token} @@ -1135,6 +1154,8 @@ conn.request(method, path, '', req_headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() store_response(resp, response_dict) @@ -1160,10 +1181,12 @@ :param service_token: service auth token :raises ClientException: HTTP POST request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url) + close_conn = True path = '%s/%s' % (parsed.path, quote(container)) method = 'POST' req_headers = {'X-Auth-Token': token} @@ -1176,6 +1199,8 @@ conn.request(method, path, '', req_headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log(('%s%s' % (url.replace(parsed.path, ''), path), method,), {'headers': req_headers}, resp, body) @@ -1204,10 +1229,12 @@ :param headers: additional headers to include in the request :raises ClientException: HTTP DELETE request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url) + close_conn = True path = '%s/%s' % (parsed.path, quote(container)) if headers: headers = dict(headers) @@ -1223,6 +1250,8 @@ conn.request(method, path, '', headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log(('%s%s' % (url.replace(parsed.path, ''), path), method,), {'headers': headers}, resp, body) @@ -1244,7 +1273,8 @@ :param container: container name that the object is in :param name: object name to get :param http_conn: a tuple of (parsed url, HTTPConnection object), - (If None, it will create the conn object) + (If None, it will create the conn object and close it + after all content is read) :param resp_chunk_size: if defined, chunk size of data to read. NOTE: If you specify a resp_chunk_size you must fully read the object's contents before making another @@ -1259,10 +1289,12 @@ headers will be a dict and all header names will be lowercase. :raises ClientException: HTTP GET request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url) + close_conn = True path = '%s/%s/%s' % (parsed.path, quote(container), quote(name)) if query_string: path += '?' + query_string @@ -1285,9 +1317,12 @@ {'headers': headers}, resp, body) raise ClientException.from_response(resp, 'Object GET failed', body) if resp_chunk_size: - object_body = _ObjectBody(resp, resp_chunk_size) + object_body = _ObjectBody(resp, resp_chunk_size, + conn_to_close=conn if close_conn else None) else: object_body = resp.read() + if close_conn: + conn.close() http_log(('%s%s' % (url.replace(parsed.path, ''), path), method,), {'headers': headers}, resp, None) @@ -1311,10 +1346,12 @@ be lowercase) :raises ClientException: HTTP HEAD request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url) + close_conn = True path = '%s/%s/%s' % (parsed.path, quote(container), quote(name)) if query_string: path += '?' + query_string @@ -1329,6 +1366,8 @@ conn.request(method, path, '', headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log(('%s%s' % (url.replace(parsed.path, ''), path), method,), {'headers': headers}, resp, body) if resp.status < 200 or resp.status >= 300: @@ -1378,10 +1417,12 @@ :returns: etag :raises ClientException: HTTP PUT request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url, proxy=proxy) + close_conn = True path = parsed.path if container: path = '%s/%s' % (path.rstrip('/'), quote(container)) @@ -1440,6 +1481,8 @@ resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log(('%s%s' % (url.replace(parsed.path, ''), path), 'PUT',), {'headers': headers}, resp, body) @@ -1469,10 +1512,12 @@ :param service_token: service auth token :raises ClientException: HTTP POST request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url) + close_conn = True path = '%s/%s/%s' % (parsed.path, quote(container), quote(name)) req_headers = {'X-Auth-Token': token} if service_token: @@ -1482,6 +1527,8 @@ conn.request('POST', path, '', req_headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log(('%s%s' % (url.replace(parsed.path, ''), path), 'POST',), {'headers': req_headers}, resp, body) @@ -1514,10 +1561,12 @@ :param service_token: service auth token :raises ClientException: HTTP COPY request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url) + close_conn = True path = parsed.path container = quote(container) @@ -1546,6 +1595,8 @@ conn.request('COPY', path, '', headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log(('%s%s' % (url.replace(parsed.path, ''), path), 'COPY',), {'headers': headers}, resp, body) @@ -1578,10 +1629,12 @@ :param service_token: service auth token :raises ClientException: HTTP DELETE request failed """ + close_conn = False if http_conn: parsed, conn = http_conn else: parsed, conn = http_connection(url, proxy=proxy) + close_conn = True path = parsed.path if container: path = '%s/%s' % (path.rstrip('/'), quote(container)) @@ -1600,6 +1653,8 @@ conn.request('DELETE', path, '', headers) resp = conn.getresponse() body = resp.read() + if close_conn: + conn.close() http_log(('%s%s' % (url.replace(parsed.path, ''), path), 'DELETE',), {'headers': headers}, resp, body) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/swiftclient/exceptions.py new/python-swiftclient-3.11.1/swiftclient/exceptions.py --- old/python-swiftclient-3.10.1/swiftclient/exceptions.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/swiftclient/exceptions.py 2021-03-10 15:57:30.000000000 +0100 @@ -35,6 +35,13 @@ self.http_response_content = http_response_content self.http_response_headers = http_response_headers + self.transaction_id = None + if self.http_response_headers: + for header in ('X-Trans-Id', 'X-Openstack-Request-Id'): + if header in self.http_response_headers: + self.transaction_id = self.http_response_headers[header] + break + @classmethod def from_response(cls, resp, msg=None, body=None): msg = msg or '%s %s' % (resp.status_code, resp.reason) @@ -78,4 +85,7 @@ else: b += ' [first 60 chars of response] %s' \ % self.http_response_content[:60] - return b and '%s: %s' % (a, b) or a + c = '' + if self.transaction_id: + c = ' (txn: %s)' % self.transaction_id + return b and '%s: %s%s' % (a, b, c) or (a + c) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/swiftclient/shell.py new/python-swiftclient-3.11.1/swiftclient/shell.py --- old/python-swiftclient-3.10.1/swiftclient/shell.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/swiftclient/shell.py 2021-03-10 15:57:30.000000000 +0100 @@ -78,8 +78,8 @@ for multiple objects. Optional arguments: - -a, --all Delete all containers and objects. - --versions Delete all versions + -a, --all Delete all containers and objects. Implies --versions. + --versions Delete all versions. --leave-segments Do not delete segments of manifest objects. -H, --header <header:value> Adds a custom request header to use for deleting @@ -132,6 +132,8 @@ (options, args) = parse_args(parser, args) args = args[1:] + if options['yes_all']: + options['versions'] = True if (not args and not options['yes_all']) or (args and options['yes_all']): output_manager.error('Usage: %s delete %s\n%s', BASENAME, st_delete_options, @@ -2058,8 +2060,9 @@ try: globals()['st_%s' % args[0]](parser, argv[1:], output) except ClientException as err: + trans_id = err.transaction_id + err.transaction_id = None # clear it so we aren't overly noisy output.error(str(err)) - trans_id = (err.http_response_headers or {}).get('X-Trans-Id') if trans_id: output.error("Failed Transaction ID: %s", parse_header_string(trans_id)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/test/functional/__init__.py new/python-swiftclient-3.11.1/test/functional/__init__.py --- old/python-swiftclient-3.10.1/test/functional/__init__.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/test/functional/__init__.py 2021-03-10 15:57:30.000000000 +0100 @@ -58,6 +58,11 @@ conf['auth_url'] = auth_url try: + conf['cacert'] = parser.get('func_test', 'cacert') + except configparser.NoOptionError: + conf['cacert'] = None + + try: conf['account_username'] = parser.get('func_test', 'account_username') except configparser.NoOptionError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/test/functional/test_openstacksdk.py new/python-swiftclient-3.11.1/test/functional/test_openstacksdk.py --- old/python-swiftclient-3.10.1/test/functional/test_openstacksdk.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/test/functional/test_openstacksdk.py 2021-03-10 15:57:30.000000000 +0100 @@ -35,6 +35,7 @@ auth_url=TEST_CONFIG['auth_url'], username=TEST_CONFIG['account_username'], password=TEST_CONFIG['password'], + cacert=TEST_CONFIG['cacert'], ) cls.object_store = cls.conn.object_store diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/test/functional/test_swiftclient.py new/python-swiftclient-3.11.1/test/functional/test_swiftclient.py --- old/python-swiftclient-3.10.1/test/functional/test_swiftclient.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/test/functional/test_swiftclient.py 2021-03-10 15:57:30.000000000 +0100 @@ -42,6 +42,7 @@ def _get_config(self): self.auth_url = TEST_CONFIG['auth_url'] + self.cacert = TEST_CONFIG['cacert'] self.auth_version = TEST_CONFIG['auth_version'] self.account_username = TEST_CONFIG['account_username'] self.password = TEST_CONFIG['password'] @@ -52,7 +53,7 @@ """ return swiftclient.Connection( self.auth_url, self.account_username, self.password, - auth_version=self.auth_version) + auth_version=self.auth_version, cacert=self.cacert) def setUp(self): super(TestFunctional, self).setUp() @@ -486,7 +487,7 @@ return swiftclient.Connection( self.auth_url, username, self.password, - auth_version=self.auth_version, + auth_version=self.auth_version, cacert=self.cacert, os_options={'tenant_name': account}) @@ -515,4 +516,5 @@ 'user_domain_name': user_domain} return swiftclient.Connection(self.auth_url, username, password, auth_version=self.auth_version, + cacert=self.cacert, os_options=os_options) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/test/sample.conf new/python-swiftclient-3.11.1/test/sample.conf --- old/python-swiftclient-3.10.1/test/sample.conf 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/test/sample.conf 2021-03-10 15:57:30.000000000 +0100 @@ -6,6 +6,11 @@ #auth_version = 2 #auth_uri = http://localhost:5000/v2.0/ +# You may want to run tests against endpoints that use development certs +# without installing the CA system-wide. Use this to trust an extra set +# of certificates. +#cacert = /path/to/trusted-ca.crt + # Primary functional test account (needs admin access to the account). # By default the tests use a swiftclient.client.Connection instance with user # attribute set to 'account:username' based on the options 'account' and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/test/unit/test_shell.py new/python-swiftclient-3.11.1/test/unit/test_shell.py --- old/python-swiftclient-3.10.1/test/unit/test_shell.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/test/unit/test_shell.py 2021-03-10 15:57:30.000000000 +0100 @@ -1260,8 +1260,7 @@ [None, [{'name': 'empty_container'}]], [None, []], ] - # N.B: missing --versions flag, version-id gets ignored - # only latest object is deleted + # N.B: --all implies --versions, clear it all out connection.return_value.get_container.side_effect = [ [None, [{'name': 'object'}, {'name': 'obj\xe9ct2'}]], [None, []], @@ -1279,7 +1278,7 @@ response_dict={}, headers={}), mock.call('container', 'obj\xe9ct2', query_string='', response_dict={}, headers={}), - mock.call('container2', 'object', query_string='', + mock.call('container2', 'object', query_string='version-id=1', response_dict={}, headers={})], any_order=True) self.assertEqual(3, connection.return_value.delete_object.call_count, 'Expected 3 calls but found\n%r' @@ -1547,7 +1546,7 @@ [None, []], ] connection.return_value.attempts = 0 - argv = ["", "delete", "--versions", "container"] + argv = ["", "delete", "--versions", "container", "--object-threads=1"] connection.return_value.head_object.return_value = {} swiftclient.shell.main(argv) connection.return_value.delete_container.assert_called_with( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/test/unit/test_swiftclient.py new/python-swiftclient-3.11.1/test/unit/test_swiftclient.py --- old/python-swiftclient-3.10.1/test/unit/test_swiftclient.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/test/unit/test_swiftclient.py 2021-03-10 15:57:30.000000000 +0100 @@ -84,6 +84,23 @@ self.assertIs(True, hasattr(exc, key)) self.assertEqual(getattr(exc, key), value) + def test_transaction_id_from_headers(self): + exc = c.ClientException('test') + self.assertIsNone(exc.transaction_id) + + exc = c.ClientException('test', http_response_headers={}) + self.assertIsNone(exc.transaction_id) + + exc = c.ClientException('test', http_response_headers={ + 'X-Trans-Id': 'some-id'}) + self.assertEqual(exc.transaction_id, 'some-id') + self.assertIn('(txn: some-id)', str(exc)) + + exc = c.ClientException('test', http_response_headers={ + 'X-Openstack-Request-Id': 'some-other-id'}) + self.assertEqual(exc.transaction_id, 'some-other-id') + self.assertIn('(txn: some-other-id)', str(exc)) + class MockHttpResponse(object): def __init__(self, status=0, headers=None, verify=False): @@ -785,6 +802,7 @@ self.assertRequests([ ('HEAD', 'http://www.tests.com', '', {'x-auth-token': 'asdf'}) ]) + self.assertTrue(self.request_log[-1][-1]._closed) def test_server_error(self): body = 'c' * 65 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/test/unit/utils.py new/python-swiftclient-3.11.1/test/unit/utils.py --- old/python-swiftclient-3.10.1/test/unit/utils.py 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/test/unit/utils.py 2021-03-10 15:57:30.000000000 +0100 @@ -109,6 +109,7 @@ self.timestamp = timestamp self.headers = headers or {} self.request = None + self._closed = False def getresponse(self): if kwargs.get('raise_exc'): @@ -167,7 +168,7 @@ return dict(self.getheaders()).get(name.lower(), default) def close(self): - pass + self._closed = True timestamps_iter = iter(kwargs.get('timestamps') or ['1'] * len(code_iter)) etag_iter = iter(kwargs.get('etags') or [None] * len(code_iter)) @@ -248,7 +249,8 @@ class RequestsWrapper(object): def close(self): - pass + if hasattr(self, 'resp'): + self.resp.close() conn = RequestsWrapper() def request(method, path, *args, **kwargs): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/test-requirements.txt new/python-swiftclient-3.11.1/test-requirements.txt --- old/python-swiftclient-3.10.1/test-requirements.txt 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/test-requirements.txt 2021-03-10 15:57:30.000000000 +0100 @@ -1,4 +1,5 @@ -hacking>=1.1.0,<1.2.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0;python_version<'3.0' # Apache-2.0 +hacking>=3.2.0,<3.3.0;python_version>='3.0' # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 keystoneauth1>=3.4.0 # Apache-2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-swiftclient-3.10.1/tox.ini new/python-swiftclient-3.11.1/tox.ini --- old/python-swiftclient-3.10.1/tox.ini 2020-09-11 20:41:44.000000000 +0200 +++ new/python-swiftclient-3.11.1/tox.ini 2021-03-10 15:57:30.000000000 +0100 @@ -102,13 +102,6 @@ deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html -[testenv:lower-constraints] -basepython = python3 -deps = - -c{toxinidir}/lower-constraints.txt - -r{toxinidir}/test-requirements.txt - .[keystone] - [testenv:pdf-docs] basepython = python3 deps = {[testenv:docs]deps}