Hello community, here is the log from the commit of package python-oslo.vmware for openSUSE:Factory checked in at 2020-06-05 20:15:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-oslo.vmware (Old) and /work/SRC/openSUSE:Factory/.python-oslo.vmware.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-oslo.vmware" Fri Jun 5 20:15:42 2020 rev:17 rq:803603 version:3.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-oslo.vmware/python-oslo.vmware.changes 2020-03-24 22:32:25.661091866 +0100 +++ /work/SRC/openSUSE:Factory/.python-oslo.vmware.new.3606/python-oslo.vmware.changes 2020-06-05 20:19:44.815771146 +0200 @@ -1,0 +2,23 @@ +Tue May 12 09:48:57 UTC 2020 - [email protected] + +- update to version 3.3.1 + - Pass "base_image_ref" to backend when transfer volume to image + - Ensure lease polling raises proper exception + - Fix object has no attribute 'readinto' in Python3 + - Document disable flake8/hacking warnings + - [ussuri][goal] Drop python 2.7 support and testing + - Add ability to change read chunk size + - Adds standard file operation functions + - tox: Trivial cleanup + - Update hacking for Python3 + - remove outdated header + - Use unittest.mock instead of third party mock + - Pass "store_id" to backend when transfer volume to image + - Update the tox minversion parameter. + - tox: Keeping going with docs + - reword releasenote for py27 support dropping + - Switch to Ussuri jobs + - Drop use of six + - Update master for stable/train + +------------------------------------------------------------------- Old: ---- oslo.vmware-2.34.1.tar.gz New: ---- oslo.vmware-3.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-oslo.vmware.spec ++++++ --- /var/tmp/diff_new_pack.ELrEcp/_old 2020-06-05 20:19:45.947774995 +0200 +++ /var/tmp/diff_new_pack.ELrEcp/_new 2020-06-05 20:19:45.951775009 +0200 @@ -17,13 +17,13 @@ Name: python-oslo.vmware -Version: 2.34.1 +Version: 3.3.1 Release: 0 Summary: Oslo VMware library for OpenStack projects License: Apache-2.0 Group: Development/Languages/Python URL: https://launchpad.net/oslo.vmware -Source0: https://files.pythonhosted.org/packages/source/o/oslo.vmware/oslo.vmware-2.34.1.tar.gz +Source0: https://files.pythonhosted.org/packages/source/o/oslo.vmware/oslo.vmware-3.3.1.tar.gz BuildRequires: openstack-macros BuildRequires: python3-Babel BuildRequires: python3-ddt @@ -67,7 +67,7 @@ Requires: python3-oslo.i18n >= 3.15.3 Requires: python3-oslo.utils >= 3.33.0 Requires: python3-requests >= 2.14.2 -Requires: python3-six >= 1.10.0 +Requires: python3-six Requires: python3-stevedore >= 1.20.0 Requires: python3-suds-jurko >= 0.6 Requires: python3-urllib3 >= 1.21.1 @@ -93,7 +93,7 @@ Documentation for OpenStack common VMware library. %prep -%autosetup -p1 -n oslo.vmware-2.34.1 +%autosetup -p1 -n oslo.vmware-3.3.1 %py_req_cleanup %build @@ -108,6 +108,8 @@ %py3_install %check +# don't want to depend on hacking for package building +rm oslo_vmware/tests/test_hacking.py python3 -m stestr.cli run %files -n python3-oslo.vmware ++++++ _service ++++++ --- /var/tmp/diff_new_pack.ELrEcp/_old 2020-06-05 20:19:45.987775132 +0200 +++ /var/tmp/diff_new_pack.ELrEcp/_new 2020-06-05 20:19:45.987775132 +0200 @@ -1,8 +1,8 @@ <services> <service mode="disabled" name="renderspec"> - <param name="input-template">https://raw.githubusercontent.com/openstack/rpm-packaging/stable/train/openstack/oslo.vmware/oslo.vmware.spec.j2</param> + <param name="input-template">https://opendev.org/openstack/rpm-packaging/raw/branch/stable/ussuri/openstack/oslo.vmware/oslo.vmware.spec.j2</param> <param name="output-name">python-oslo.vmware.spec</param> - <param name="requirements">https://raw.githubusercontent.com/openstack/oslo.vmware/stable/train/requirements.txt</param> + <param name="requirements">https://opendev.org/openstack/oslo.vmware/raw/branch/stable/ussuri/requirements.txt</param> <param name="changelog-email">[email protected]</param> <param name="changelog-provider">gh,openstack,oslo.vmware</param> </service> ++++++ oslo.vmware-2.34.1.tar.gz -> oslo.vmware-3.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/.zuul.yaml new/oslo.vmware-3.3.1/.zuul.yaml --- old/oslo.vmware-2.34.1/.zuul.yaml 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/.zuul.yaml 2020-04-07 12:12:11.000000000 +0200 @@ -1,10 +1,8 @@ - project: templates: - check-requirements - - lib-forward-testing - lib-forward-testing-python3 - openstack-lower-constraints-jobs - - openstack-python-jobs - - openstack-python3-train-jobs + - openstack-python3-ussuri-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/AUTHORS new/oslo.vmware-3.3.1/AUTHORS --- old/oslo.vmware-2.34.1/AUTHORS 2019-09-04 16:26:02.000000000 +0200 +++ new/oslo.vmware-3.3.1/AUTHORS 2020-04-07 12:13:24.000000000 +0200 @@ -10,7 +10,9 @@ ChangBo Guo(gcb) <[email protected]> Christian Berendt <[email protected]> Corey Bryant <[email protected]> +Damon Li <[email protected]> Dan Prince <[email protected]> +Daniel Bengtsson <[email protected]> Davanum Srinivas <[email protected]> Davanum Srinivas <[email protected]> Doug Hellmann <[email protected]> @@ -21,6 +23,8 @@ Ghanshyam Mann <[email protected]> Giridhar Jayavelu <[email protected]> Haifeng.Yan <[email protected]> +Hemna <[email protected]> +Hervé Beraud <[email protected]> James Carey <[email protected]> Janonymous <[email protected]> Javeme <[email protected]> @@ -37,6 +41,7 @@ Nguyen Van Trung <[email protected]> OpenStack Release Bot <[email protected]> Radoslav Gerganov <[email protected]> +Rajat Dhasmana <[email protected]> Ronald Bradford <[email protected]> Ryan Hsu <[email protected]> Ryan Hsu <[email protected]> @@ -56,6 +61,7 @@ ZhongShengping <[email protected]> Zhongcheng Lao <[email protected]> avnish <[email protected]> +caoyuan <[email protected]> howardlee <[email protected]> int32bit <[email protected]> jacky06 <[email protected]> @@ -64,6 +70,8 @@ qingszhao <[email protected]> ricolin <[email protected]> wangqi <[email protected]> +xuel <[email protected]> zhang.lei <[email protected]> +zhangboye <[email protected]> zhangdaolong <[email protected]> zhu.rong <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/ChangeLog new/oslo.vmware-3.3.1/ChangeLog --- old/oslo.vmware-2.34.1/ChangeLog 2019-09-04 16:26:02.000000000 +0200 +++ new/oslo.vmware-3.3.1/ChangeLog 2020-04-07 12:13:24.000000000 +0200 @@ -1,6 +1,52 @@ CHANGES ======= +3.3.1 +----- + +* Use unittest.mock instead of third party mock +* Document disable flake8/hacking warnings + +3.3.0 +----- + +* Update hacking for Python3 + +3.2.1 +----- + +* Fix object has no attribute 'readinto' in Python3 +* Update the tox minversion parameter +* Pass "base\_image\_ref" to backend when transfer volume to image +* Drop use of six + +3.2.0 +----- + + +3.1.0 +----- + +* remove outdated header +* Ensure lease polling raises proper exception +* reword releasenote for py27 support dropping +* Adds standard file operation functions +* Add ability to change read chunk size + +3.0.0 +----- + +* [ussuri][goal] Drop python 2.7 support and testing + +2.35.0 +------ + +* Pass "store\_id" to backend when transfer volume to image +* tox: Trivial cleanup +* Switch to Ussuri jobs +* tox: Keeping going with docs +* Update master for stable/train + 2.34.1 ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/PKG-INFO new/oslo.vmware-3.3.1/PKG-INFO --- old/oslo.vmware-2.34.1/PKG-INFO 2019-09-04 16:26:02.000000000 +0200 +++ new/oslo.vmware-3.3.1/PKG-INFO 2020-04-07 12:13:24.000000000 +0200 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: oslo.vmware -Version: 2.34.1 +Version: 3.3.1 Summary: Oslo VMware library Home-page: https://docs.openstack.org/oslo.vmware/latest/ Author: OpenStack @@ -44,8 +44,9 @@ Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: Implementation :: CPython +Requires-Python: >=3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/bindep.txt new/oslo.vmware-3.3.1/bindep.txt --- old/oslo.vmware-2.34.1/bindep.txt 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/bindep.txt 2020-04-07 12:12:11.000000000 +0200 @@ -6,8 +6,6 @@ libxml2-dev [platform:dpkg test] libxslt1-dev [platform:dpkg test] libxslt-devel [platform:rpm test] -python-dev [platform:dpkg test] -python-devel [platform:rpm test] python3-dev [platform:dpkg test] python3-devel [platform:rpm test] libpcre3-dev [platform:dpkg test] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/doc/requirements.txt new/oslo.vmware-3.3.1/doc/requirements.txt --- old/oslo.vmware-2.34.1/doc/requirements.txt 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/doc/requirements.txt 2020-04-07 12:12:11.000000000 +0200 @@ -3,8 +3,7 @@ # process, which may cause wedges in the gate later. # These are needed for docs generation openstackdocstheme>=1.20.0 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD -sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD +sphinx>=1.8.0,!=2.1.0 # BSD reno>=2.5.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD sphinxcontrib-apidoc>=0.2.0 # BSD diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/lower-constraints.txt new/oslo.vmware-3.3.1/lower-constraints.txt --- old/oslo.vmware-2.34.1/lower-constraints.txt 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/lower-constraints.txt 2020-04-07 12:12:11.000000000 +0200 @@ -22,8 +22,6 @@ lxml==3.4.1 MarkupSafe==1.0 mccabe==0.2.1 -mock==2.0.0 -monotonic==0.6 netaddr==0.7.18 netifaces==0.10.4 openstackdocstheme==1.20.0 @@ -44,10 +42,9 @@ reno==2.5.0 requests==2.14.2 rfc3986==0.3.1 -six==1.10.0 smmap==0.9.0 snowballstemmer==1.2.1 -Sphinx==1.6.2 +Sphinx==1.8.0 sphinxcontrib-websupport==1.0.1 stestr==2.0.0 stevedore==1.20.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo.vmware.egg-info/PKG-INFO new/oslo.vmware-3.3.1/oslo.vmware.egg-info/PKG-INFO --- old/oslo.vmware-2.34.1/oslo.vmware.egg-info/PKG-INFO 2019-09-04 16:26:02.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo.vmware.egg-info/PKG-INFO 2020-04-07 12:13:24.000000000 +0200 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: oslo.vmware -Version: 2.34.1 +Version: 3.3.1 Summary: Oslo VMware library Home-page: https://docs.openstack.org/oslo.vmware/latest/ Author: OpenStack @@ -44,8 +44,9 @@ Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: Implementation :: CPython +Requires-Python: >=3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo.vmware.egg-info/SOURCES.txt new/oslo.vmware-3.3.1/oslo.vmware.egg-info/SOURCES.txt --- old/oslo.vmware-2.34.1/oslo.vmware.egg-info/SOURCES.txt 2019-09-04 16:26:02.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo.vmware.egg-info/SOURCES.txt 2020-04-07 12:13:24.000000000 +0200 @@ -100,6 +100,7 @@ oslo_vmware/wsdl/6.7/reflect-types.xsd oslo_vmware/wsdl/6.7/vim-types.xsd releasenotes/notes/add_reno-3b4ae0789e9c45b4.yaml +releasenotes/notes/drop-python27-support-4991a70046af4b03.yaml releasenotes/source/conf.py releasenotes/source/index.rst releasenotes/source/newton.rst @@ -108,6 +109,7 @@ releasenotes/source/queens.rst releasenotes/source/rocky.rst releasenotes/source/stein.rst +releasenotes/source/train.rst releasenotes/source/unreleased.rst releasenotes/source/_static/.placeholder releasenotes/source/_templates/.placeholder diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo.vmware.egg-info/pbr.json new/oslo.vmware-3.3.1/oslo.vmware.egg-info/pbr.json --- old/oslo.vmware-2.34.1/oslo.vmware.egg-info/pbr.json 2019-09-04 16:26:02.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo.vmware.egg-info/pbr.json 2020-04-07 12:13:24.000000000 +0200 @@ -1 +1 @@ -{"git_version": "c592465", "is_release": true} \ No newline at end of file +{"git_version": "c9c3416", "is_release": true} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo.vmware.egg-info/requires.txt new/oslo.vmware-3.3.1/oslo.vmware.egg-info/requires.txt --- old/oslo.vmware-2.34.1/oslo.vmware.egg-info/requires.txt 2019-09-04 16:26:02.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo.vmware.egg-info/requires.txt 2020-04-07 12:13:24.000000000 +0200 @@ -1,7 +1,6 @@ pbr!=2.1.0,>=2.0.0 stevedore>=1.20.0 netaddr>=0.7.18 -six>=1.10.0 oslo.i18n>=3.15.3 oslo.utils>=3.33.0 PyYAML>=3.12 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/api.py new/oslo.vmware-3.3.1/oslo_vmware/api.py --- old/oslo.vmware-2.34.1/oslo_vmware/api.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/api.py 2020-04-07 12:12:11.000000000 +0200 @@ -27,7 +27,6 @@ from oslo_context import context from oslo_utils import excutils from oslo_utils import reflection -import six from oslo_vmware._i18n import _ from oslo_vmware.common import loopingcall @@ -339,7 +338,7 @@ fault = excep.fault_list[0] clazz = exceptions.get_fault_class(fault) if clazz: - raise clazz(six.text_type(excep), + raise clazz(str(excep), details=excep.details) raise @@ -375,7 +374,7 @@ except exceptions.VimException as ex: LOG.debug("Error: %(error)s occurred while checking whether the " "current session: %(session)s is active.", - {'error': six.text_type(ex), + {'error': str(ex), 'session': _trunc_id(self._session_id)}) return is_active @@ -446,16 +445,7 @@ get_completed_task()) raise loopingcall.LoopingCallDone(task_info) else: - error_msg = six.text_type(task_info.error.localizedMessage) - error = task_info.error - name = error.fault.__class__.__name__ - fault_class = exceptions.get_fault_class(name) - if fault_class: - task_ex = fault_class(error_msg) - else: - task_ex = exceptions.VimFaultException([name], - error_msg) - raise task_ex + raise exceptions.translate_fault(task_info.error) def wait_for_lease_ready(self, lease): """Waits for the given lease to be ready. @@ -506,7 +496,7 @@ "%(error_msg)s.") % {'lease': lease, 'error_msg': error_msg} LOG.error(excep_msg) - raise exceptions.VimException(excep_msg) + raise exceptions.translate_fault(error_msg, excep_msg) else: # unknown state excep_msg = _("Unknown state: %(state)s for lease: " diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/exceptions.py new/oslo.vmware-3.3.1/oslo_vmware/exceptions.py --- old/oslo.vmware-2.34.1/oslo_vmware/exceptions.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/exceptions.py 2020-04-07 12:12:11.000000000 +0200 @@ -19,8 +19,6 @@ import logging -import six - from oslo_vmware._i18n import _ LOG = logging.getLogger(__name__) @@ -53,11 +51,8 @@ """ msg_fmt = _("An unknown exception occurred.") - if six.PY2: - __str__ = lambda self: six.text_type(self).encode('utf8') - __unicode__ = lambda self: self.description - else: - __str__ = lambda self: self.description + def __str__(self): + return self.description def __init__(self, message=None, details=None, **kwargs): @@ -80,7 +75,7 @@ # kwargs doesn't match a variable in the message # log the issue and the kwargs LOG.exception('Exception in string format operation') - for name, value in six.iteritems(kwargs): + for name, value in kwargs.items(): LOG.error("%(name)s: %(value)s", {'name': name, 'value': value}) # at least get the core message out if something happened @@ -98,9 +93,9 @@ # NOTE(jecarey): self.msg and self.cause may be i18n objects # that do not support str or concatenation, but can be used # as replacement text. - descr = six.text_type(self.msg) + descr = str(self.msg) if self.cause: - descr += '\nCause: ' + six.text_type(self.cause) + descr += '\nCause: ' + str(self.cause) return descr @@ -154,7 +149,7 @@ if self.details: # details may contain non-ASCII values details = '{%s}' % ', '.join(["'%s': '%s'" % (k, v) for k, v in - six.iteritems(self.details)]) + self.details.items()]) descr += '\nDetails: ' + details return descr @@ -296,6 +291,32 @@ return fault_class +def translate_fault(localized_method_fault, excep_msg=None): + """Produce proper VimException subclass object, + + The exception is based on a vmodl.LocalizedMethodFault. + + :param excep_msg: Message to set to the exception. Defaults to + localizedMessage of the fault. + """ + try: + if not excep_msg: + excep_msg = str(localized_method_fault.localizedMessage) + name = localized_method_fault.fault.__class__.__name__ + fault_class = get_fault_class(name) + if fault_class: + ex = fault_class(excep_msg) + else: + ex = VimFaultException([name], excep_msg) + except Exception as e: + LOG.debug("Unexpected exception thrown (%s) while translating" + " fault (%s) with message: %s.", + e, localized_method_fault, excep_msg) + ex = VimException(message=excep_msg, cause=e) + + return ex + + def register_fault_class(name, exception): fault_class = _fault_classes_registry.get(name) if not issubclass(exception, VimException): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/hacking/checks.py new/oslo.vmware-3.3.1/oslo_vmware/hacking/checks.py --- old/oslo.vmware-2.34.1/oslo_vmware/hacking/checks.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/hacking/checks.py 2020-04-07 12:12:11.000000000 +0200 @@ -14,6 +14,8 @@ import re +from hacking import core + _all_log_levels = {'critical', 'error', 'exception', 'info', 'warning', 'debug'} @@ -28,6 +30,7 @@ }) [email protected] def no_translate_logs(logical_line, filename): """N537 - Don't translate logs. @@ -46,7 +49,3 @@ """ if _log_translation_hint.match(logical_line): yield (0, "N537: Log messages should not be translated!") - - -def factory(register): - register(no_translate_logs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/image_transfer.py new/oslo.vmware-3.3.1/oslo_vmware/image_transfer.py --- old/oslo.vmware-2.34.1/oslo_vmware/image_transfer.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/image_transfer.py 2020-04-07 12:12:11.000000000 +0200 @@ -21,7 +21,6 @@ import tarfile from eventlet import timeout -import six from oslo_utils import units from oslo_vmware._i18n import _ @@ -330,7 +329,7 @@ LOG.warning("The keyword argument 'image_version' is deprecated " "and will be ignored in the next release.") - image_ver = six.text_type(kwargs.get('image_version')) + image_ver = str(kwargs.get('image_version')) image_metadata = {'disk_format': 'vmdk', 'name': kwargs.get('image_name'), 'properties': {'vmware_image_version': image_ver, @@ -338,10 +337,13 @@ 'owner_id': owner_id}} updater = loopingcall.FixedIntervalLoopingCall(read_handle.update_progress) + store_id = kwargs.get('store_id') + base_image_ref = kwargs.get('base_image_ref') try: updater.start(interval=NFC_LEASE_UPDATE_PERIOD) image_service.update(context, image_id, image_metadata, - data=read_handle) + data=read_handle, store_id=store_id, + base_image_ref=base_image_ref) finally: updater.stop() read_handle.close() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/objects/datastore.py new/oslo.vmware-3.3.1/oslo_vmware/objects/datastore.py --- old/oslo.vmware-2.34.1/oslo_vmware/objects/datastore.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/objects/datastore.py 2020-04-07 12:12:11.000000000 +0200 @@ -17,8 +17,8 @@ import random import re -import six.moves.http_client as httplib -import six.moves.urllib.parse as urlparse +import http.client as httplib +import urllib.parse as urlparse from oslo_vmware._i18n import _ from oslo_vmware import constants @@ -445,8 +445,8 @@ httplib.CannotSendHeader) as excep: excep_msg = _("Error occurred while creating HTTP connection " "to write to file with URL = %s.") % str(self) - LOG.exception(excep_msg) - raise exceptions.VimConnectionException(excep_msg, excep) + LOG.exception(excep_msg) + raise exceptions.VimConnectionException(excep_msg, excep) def get_transfer_ticket(self, session, method): client_factory = session.vim.client.factory diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/pbm.py new/oslo.vmware-3.3.1/oslo_vmware/pbm.py --- old/oslo.vmware-2.34.1/oslo_vmware/pbm.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/pbm.py 2020-04-07 12:12:11.000000000 +0200 @@ -23,8 +23,8 @@ import logging import os -import six.moves.urllib.parse as urlparse -import six.moves.urllib.request as urllib +import urllib.parse as urlparse +import urllib.request as urllib from oslo_vmware import service from oslo_vmware import vim_util diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/rw_handles.py new/oslo.vmware-3.3.1/oslo_vmware/rw_handles.py --- old/oslo.vmware-2.34.1/oslo_vmware/rw_handles.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/rw_handles.py 2020-04-07 12:12:11.000000000 +0200 @@ -28,8 +28,7 @@ from oslo_utils import excutils from oslo_utils import netutils import requests -import six -import six.moves.urllib.parse as urlparse +import urllib.parse as urlparse from urllib3 import connection as httplib from oslo_vmware._i18n import _ @@ -135,7 +134,7 @@ self._build_vim_cookie_header(cookies)}) if content_type: headers.update({'Content-Type': content_type}) - for key, value in six.iteritems(headers): + for key, value in headers.items(): conn.putheader(key, value) conn.endheaders() return conn @@ -177,6 +176,32 @@ """ raise NotImplementedError() + def tell(self): + """Get the position of File Handle + + :return: position + """ + raise NotImplementedError() + + def fileno(self): + """returns the integer file descriptor + by default this is not supported and raises IOError + """ + raise IOError() + + def seek(self, offset): + """sets the file's current position at the offset + + :param offset: offset + """ + pass + + def flush(self): + """flushes the internal buffer + + """ + pass + def get_size(self): """Get size of the file to be read. @@ -484,6 +509,9 @@ """"Get managed object reference of the VM created for import.""" return self._vm_ref + def tell(self): + return self._bytes_written + def write(self, data): """Write data to the file. @@ -565,7 +593,7 @@ ssl_thumbprint=thumbprint) super(VmdkReadHandle, self).__init__(session, lease, url, self._conn) - def read(self, chunk_size): + def read(self, chunk_size=READ_CHUNKSIZE): """Read a chunk of data from the VMDK file. :param chunk_size: size of read chunk @@ -573,7 +601,7 @@ :raises: VimException """ try: - data = self._file_handle.read(READ_CHUNKSIZE) + data = self._file_handle.read(chunk_size) self._bytes_read += len(data) return data except Exception as excep: @@ -585,6 +613,9 @@ LOG.exception(excep_msg) raise exceptions.VimException(excep_msg, excep) + def tell(self): + return self._bytes_read + def close(self): """Releases the lease and close the connection. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/service.py new/oslo.vmware-3.3.1/oslo_vmware/service.py --- old/oslo.vmware-2.34.1/oslo_vmware/service.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/service.py 2020-04-07 12:12:11.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright (c) 2014 VMware, Inc. +# Copyright (c) 2014-2020 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -17,15 +17,14 @@ Common classes that provide access to vSphere services. """ +import http.client as httplib +import io import logging -import os import netaddr from oslo_utils import timeutils from oslo_utils import uuidutils import requests -import six -import six.moves.http_client as httplib import suds from suds import cache from suds import client @@ -96,7 +95,7 @@ context.envelope.walk(self.add_attribute_for_value) -class Response(six.BytesIO): +class Response(io.BytesIO): """Response with an input stream as source.""" def __init__(self, stream, status=200, headers=None): @@ -104,7 +103,7 @@ self.headers = headers or {} self.reason = requests.status_codes._codes.get( status, [''])[0].upper().replace('_', ' ') - six.BytesIO.__init__(self, stream) + io.BytesIO.__init__(self, stream) @property def _original_response(self): @@ -115,7 +114,7 @@ return self def read(self, chunk_size, **kwargs): - return six.BytesIO.read(self, chunk_size) + return io.BytesIO.read(self, chunk_size) def info(self): return self @@ -144,9 +143,9 @@ def _build_response_from_file(self, request): file_path = request.url[7:] - with open(file_path, 'r') as f: - buff = bytearray(os.path.getsize(file_path)) - f.readinto(buff) + with open(file_path, 'rb') as f: + file_content = f.read() + buff = bytearray(file_content.decode(), "utf-8") resp = Response(buff) return self.build_response(request, resp) @@ -173,7 +172,7 @@ def open(self, request): resp = self.session.get(request.url, verify=self.verify) - return six.BytesIO(resp.content) + return io.BytesIO(resp.content) def send(self, request): resp = self.session.post(request.url, @@ -414,13 +413,13 @@ # Socket errors which need special handling; some of these # might be caused by server API call overload. - if (six.text_type(excep).find(ADDRESS_IN_USE_ERROR) != -1 or - six.text_type(excep).find(CONN_ABORT_ERROR)) != -1: + if (str(excep).find(ADDRESS_IN_USE_ERROR) != -1 or + str(excep).find(CONN_ABORT_ERROR)) != -1: raise exceptions.VimSessionOverLoadException( _("Socket error in %s.") % attr_name, excep) # Type error which needs special handling; it might be caused # by server API call overload. - elif six.text_type(excep).find(RESP_NOT_XML_ERROR) != -1: + elif str(excep).find(RESP_NOT_XML_ERROR) != -1: raise exceptions.VimSessionOverLoadException( _("Type error in %s.") % attr_name, excep) else: @@ -460,5 +459,6 @@ return True + # Set log filter to mask/truncate vCenter credentials in suds logs. suds.client.log.addFilter(SudsLogFilter()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/objects/test_datacenter.py new/oslo.vmware-3.3.1/oslo_vmware/tests/objects/test_datacenter.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/objects/test_datacenter.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/objects/test_datacenter.py 2020-04-07 12:12:11.000000000 +0200 @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from oslo_vmware.objects import datacenter from oslo_vmware.tests import base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/objects/test_datastore.py new/oslo.vmware-3.3.1/oslo_vmware/tests/objects/test_datastore.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/objects/test_datastore.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/objects/test_datastore.py 2020-04-07 12:12:11.000000000 +0200 @@ -12,9 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslo_utils import units -import six.moves.urllib.parse as urlparse +import urllib.parse as urlparse from oslo_vmware import constants from oslo_vmware.objects import datastore @@ -429,7 +430,7 @@ ds_url = datastore.DatastoreURL.urlparse(url) self.assertEqual(path, ds_url.path) - @mock.patch('six.moves.http_client.HTTPSConnection') + @mock.patch('http.client.HTTPSConnection') def test_connect(self, mock_conn): dc_path = 'datacenter-1' ds_name = 'datastore-1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/test_api.py new/oslo.vmware-3.3.1/oslo_vmware/tests/test_api.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/test_api.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/test_api.py 2020-04-07 12:12:11.000000000 +0200 @@ -14,17 +14,15 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for session management and API invocation classes. -""" +"""Unit tests for session management and API invocation classes.""" from datetime import datetime +from unittest import mock + from eventlet import greenthread -import mock -import six +from oslo_context import context import suds -from oslo_context import context from oslo_vmware import api from oslo_vmware import exceptions from oslo_vmware import pbm @@ -334,7 +332,7 @@ expected_str = "%s\nFaults: %s\nDetails: %s" % (fault_string, fault_list, details_str) - self.assertEqual(expected_str, six.text_type(e)) + self.assertEqual(expected_str, str(e)) self.assertEqual(details, e.details) def test_invoke_api_with_empty_response(self): @@ -598,7 +596,7 @@ ctx) def test_poll_task_well_known_exceptions(self): - for k, v in six.iteritems(exceptions._fault_classes_registry): + for k, v in exceptions._fault_classes_registry.items(): self._poll_task_well_known_exceptions(k, v) def test_poll_task_unknown_exception(self): @@ -607,7 +605,7 @@ 'RuntimeFault': exceptions.VimFaultException } - for k, v in six.iteritems(_unknown_exceptions): + for k, v in _unknown_exceptions.items(): self._poll_task_well_known_exceptions(k, v) def test_update_pbm_wsdl_loc(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/test_dvs_util.py new/oslo.vmware-3.3.1/oslo_vmware/tests/test_dvs_util.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/test_dvs_util.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/test_dvs_util.py 2020-04-07 12:12:11.000000000 +0200 @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for VMware DVS utility module. -""" +"""Unit tests for VMware DVS utility module.""" import collections - -import mock +from unittest import mock from oslo_vmware import dvs_util from oslo_vmware.tests import base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/test_exceptions.py new/oslo.vmware-3.3.1/oslo_vmware/tests/test_exceptions.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/test_exceptions.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/test_exceptions.py 2020-04-07 12:12:11.000000000 +0200 @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for exceptions module. -""" +"""Unit tests for exceptions module.""" +from unittest import mock + from oslo_vmware._i18n import _ from oslo_vmware import exceptions from oslo_vmware.tests import base @@ -119,3 +119,30 @@ exceptions.get_fault_class("ManagedObjectNotFound")) # Test unknown fault. self.assertIsNone(exceptions.get_fault_class("NotAFile")) + + def test_translate_fault(self): + + def fake_task(fault_class_name, error_msg=None): + task_info = mock.Mock() + task_info.localizedMessage = error_msg + if fault_class_name: + error_fault = mock.Mock() + error_fault.__class__.__name__ = fault_class_name + task_info.fault = error_fault + return task_info + + error_msg = "OUCH" + task = fake_task(exceptions.FILE_LOCKED, error_msg) + actual = exceptions.translate_fault(task) + + expected = exceptions.FileLockedException(error_msg) + self.assertEqual(expected.__class__, actual.__class__) + self.assertEqual(expected.message, actual.message) + + error_msg = "Oopsie" + task = fake_task(None, error_msg) + actual = exceptions.translate_fault(task) + expected = exceptions.VimFaultException(['Mock'], message=error_msg) + self.assertEqual(expected.__class__, actual.__class__) + self.assertEqual(expected.message, actual.message) + self.assertEqual(expected.fault_list, actual.fault_list) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/test_image_transfer.py new/oslo.vmware-3.3.1/oslo_vmware/tests/test_image_transfer.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/test_image_transfer.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/test_image_transfer.py 2020-04-07 12:12:11.000000000 +0200 @@ -13,12 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for functions and classes for image transfer. -""" +"""Unit tests for functions and classes for image transfer.""" -import mock -import six +import io +from unittest import mock from oslo_vmware import exceptions from oslo_vmware import image_transfer @@ -30,7 +28,7 @@ def test_start_transfer(self): data = b'image-data-here' - read_handle = six.BytesIO(data) + read_handle = io.BytesIO(data) write_handle = mock.Mock() image_transfer._start_transfer(read_handle, write_handle, None) write_handle.write.assert_called_once_with(data) @@ -372,6 +370,8 @@ image_name = 'fake_image' image_version = 1 + store_id = 'fake_store' + base_image_ref = 'e79161cd-5f9d-4007-8823-81a807a64332' fake_VmdkReadHandle = mock.Mock() fake_rw_handles_VmdkReadHandle.return_value = fake_VmdkReadHandle @@ -389,7 +389,9 @@ vmdk_size=image_size, is_public=is_public, image_name=image_name, - image_version=image_version) + image_version=image_version, + store_id=store_id, + base_image_ref=base_image_ref) fake_rw_handles_VmdkReadHandle.assert_called_once_with(session, host, @@ -398,14 +400,17 @@ file_path, image_size) - ver_str = six.text_type(image_version) + ver_str = str(image_version) image_metadata = {'disk_format': 'vmdk', 'name': image_name, 'properties': {'vmware_image_version': ver_str, 'vmware_disktype': 'streamOptimized', 'owner_id': owner_id}} - image_service.update.assert_called_once_with(context, - image_id, - image_metadata, - data=fake_VmdkReadHandle) + image_service.update.assert_called_once_with( + context, + image_id, + image_metadata, + data=fake_VmdkReadHandle, + store_id=store_id, + base_image_ref=base_image_ref) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/test_pbm.py new/oslo.vmware-3.3.1/oslo_vmware/tests/test_pbm.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/test_pbm.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/test_pbm.py 2020-04-07 12:12:11.000000000 +0200 @@ -13,15 +13,13 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for PBM utility methods. -""" +"""Unit tests for PBM utility methods.""" import os +from unittest import mock -import mock -import six.moves.urllib.parse as urlparse -import six.moves.urllib.request as urllib +import urllib.parse as urlparse +import urllib.request as urllib from oslo_vmware import pbm from oslo_vmware.tests import base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/test_rw_handles.py new/oslo.vmware-3.3.1/oslo_vmware/tests/test_rw_handles.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/test_rw_handles.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/test_rw_handles.py 2020-04-07 12:12:11.000000000 +0200 @@ -13,15 +13,12 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for read and write handles for image transfer. -""" +"""Unit tests for read and write handles for image transfer.""" import ssl +from unittest import mock -import mock import requests -import six from oslo_vmware import exceptions from oslo_vmware import rw_handles @@ -168,6 +165,12 @@ self.assertRaises(exceptions.VimException, handle.update_progress) + def test_fileno(self): + session = mock.Mock() + handle = rw_handles.VmdkHandle(session, None, 'fake-url', None) + + self.assertRaises(IOError, handle.fileno) + class VmdkWriteHandleTest(base.TestCase): """Tests for VmdkWriteHandle.""" @@ -228,6 +231,16 @@ self._conn.putrequest.assert_called_once_with('PUT', '/ds/disk1.vmdk') self._conn.send.assert_called_once_with(data) + def test_tell(self): + session = self._create_mock_session() + handle = rw_handles.VmdkWriteHandle(session, '10.1.2.3', 443, + 'rp-1', 'folder-1', None, + 100) + data = [1] * 10 + handle.write(data) + self.assertEqual(len(data), handle._bytes_written) + self.assertEqual(len(data), handle.tell()) + def test_write_post(self): session = self._create_mock_session() handle = rw_handles.VmdkWriteHandle(session, '10.1.2.3', 443, @@ -272,8 +285,10 @@ def setUp(self): super(VmdkReadHandleTest, self).setUp() + + def _mock_connection(self, read_data='fake-data'): self._resp = mock.Mock() - self._resp.read.return_value = 'fake-data' + self._resp.read.return_value = read_data self._conn = mock.Mock() self._conn.getresponse.return_value = self._resp patcher = mock.patch( @@ -282,7 +297,9 @@ HTTPConnectionMock = patcher.start() HTTPConnectionMock.return_value = self._conn - def _create_mock_session(self, disk=True, progress=-1): + def _create_mock_session(self, disk=True, progress=-1, + read_data='fake-data'): + self._mock_connection(read_data=read_data) device_url = mock.Mock() device_url.disk = disk device_url.url = 'http://*/ds/disk1.vmdk' @@ -323,8 +340,30 @@ handle = rw_handles.VmdkReadHandle(session, '10.1.2.3', 443, 'vm-1', '[ds] disk1.vmdk', chunk_size * 10) + fake_data = 'fake-data' data = handle.read(chunk_size) - self.assertEqual('fake-data', data) + self.assertEqual(fake_data, data) + self.assertEqual(len(fake_data), handle._bytes_read) + + def test_read_small(self): + read_data = 'fake' + session = self._create_mock_session(read_data=read_data) + + read_size = len(read_data) + handle = rw_handles.VmdkReadHandle(session, '10.1.2.3', 443, + 'vm-1', '[ds] disk1.vmdk', + read_size * 10) + handle.read(read_size) + self.assertEqual(read_size, handle._bytes_read) + + def test_tell(self): + chunk_size = rw_handles.READ_CHUNKSIZE + session = self._create_mock_session() + handle = rw_handles.VmdkReadHandle(session, '10.1.2.3', 443, + 'vm-1', '[ds] disk1.vmdk', + chunk_size * 10) + data = handle.read(chunk_size) + self.assertEqual(len(data), handle.tell()) def test_update_progress(self): chunk_size = len('fake-data') @@ -372,7 +411,7 @@ max_items = 10 item = [1] * 10 - class ImageReadIterator(six.Iterator): + class ImageReadIterator(object): def __init__(self): self.num_items = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/test_service.py new/oslo.vmware-3.3.1/oslo_vmware/tests/test_service.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/test_service.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/test_service.py 2020-04-07 12:12:11.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright (c) 2014 VMware, Inc. +# Copyright (c) 2014-2020 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -13,13 +13,12 @@ # License for the specific language governing permissions and limitations # under the License. +import http.client as httplib import io +from unittest import mock import ddt -import mock import requests -import six -import six.moves.http_client as httplib import suds from oslo_vmware import exceptions @@ -500,13 +499,10 @@ data = b"Hello World" get_size_mock.return_value = len(data) - def readinto_mock(buf): - buf[0:] = data + def read_mock(): + return data - if six.PY3: - builtin_open = 'builtins.open' - else: - builtin_open = '__builtin__.open' + builtin_open = 'builtins.open' open_mock = mock.MagicMock(name='file_handle', spec=open) file_spec = list(set(dir(io.TextIOWrapper)).union( @@ -515,7 +511,7 @@ file_handle = mock.MagicMock(spec=file_spec) file_handle.write.return_value = None file_handle.__enter__.return_value = file_handle - file_handle.readinto.side_effect = readinto_mock + file_handle.read.side_effect = read_mock open_mock.return_value = file_handle with mock.patch(builtin_open, open_mock, create=True): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/test_vim.py new/oslo.vmware-3.3.1/oslo_vmware/tests/test_vim.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/test_vim.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/test_vim.py 2020-04-07 12:12:11.000000000 +0200 @@ -13,13 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for classes to invoke VMware VI SOAP calls. -""" +"""Unit tests for classes to invoke VMware VI SOAP calls.""" import copy +from unittest import mock -import mock from oslo_i18n import fixture as i18n_fixture import suds diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/oslo_vmware/tests/test_vim_util.py new/oslo.vmware-3.3.1/oslo_vmware/tests/test_vim_util.py --- old/oslo.vmware-2.34.1/oslo_vmware/tests/test_vim_util.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/oslo_vmware/tests/test_vim_util.py 2020-04-07 12:12:11.000000000 +0200 @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for VMware API utility module. -""" +"""Unit tests for VMware API utility module.""" import collections - -import mock +from unittest import mock from oslo_vmware.tests import base from oslo_vmware import vim_util @@ -100,11 +97,6 @@ 'cr_to_rp': {'type': 'ComputeResource', 'path': 'resourcePool', 'skip': False, - 'selectSet': [rp_to_rp_sel_spec, - rp_to_vm_sel_spec]}, - 'cr_to_rp': {'type': 'ComputeResource', - 'path': 'resourcePool', - 'skip': False, 'selectSet': [rp_to_rp_sel_spec, rp_to_vm_sel_spec]}, 'ccr_to_h': {'type': 'ClusterComputeResource', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/releasenotes/notes/drop-python27-support-4991a70046af4b03.yaml new/oslo.vmware-3.3.1/releasenotes/notes/drop-python27-support-4991a70046af4b03.yaml --- old/oslo.vmware-2.34.1/releasenotes/notes/drop-python27-support-4991a70046af4b03.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/oslo.vmware-3.3.1/releasenotes/notes/drop-python27-support-4991a70046af4b03.yaml 2020-04-07 12:12:11.000000000 +0200 @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Support for Python 2.7 has been dropped. The minimum version of Python now + supported is Python 3.6. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/releasenotes/source/index.rst new/oslo.vmware-3.3.1/releasenotes/source/index.rst --- old/oslo.vmware-2.34.1/releasenotes/source/index.rst 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/releasenotes/source/index.rst 2020-04-07 12:12:11.000000000 +0200 @@ -6,6 +6,7 @@ :maxdepth: 1 unreleased + train stein rocky queens diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/releasenotes/source/train.rst new/oslo.vmware-3.3.1/releasenotes/source/train.rst --- old/oslo.vmware-2.34.1/releasenotes/source/train.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/oslo.vmware-3.3.1/releasenotes/source/train.rst 2020-04-07 12:12:11.000000000 +0200 @@ -0,0 +1,6 @@ +========================== +Train Series Release Notes +========================== + +.. release-notes:: + :branch: stable/train diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/requirements.txt new/oslo.vmware-3.3.1/requirements.txt --- old/oslo.vmware-2.34.1/requirements.txt 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/requirements.txt 2020-04-07 12:12:11.000000000 +0200 @@ -6,7 +6,6 @@ stevedore>=1.20.0 # Apache-2.0 netaddr>=0.7.18 # BSD -six>=1.10.0 # MIT oslo.i18n>=3.15.3 # Apache-2.0 oslo.utils>=3.33.0 # Apache-2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/setup.cfg new/oslo.vmware-3.3.1/setup.cfg --- old/oslo.vmware-2.34.1/setup.cfg 2019-09-04 16:26:02.000000000 +0200 +++ new/oslo.vmware-3.3.1/setup.cfg 2020-04-07 12:13:24.000000000 +0200 @@ -6,6 +6,7 @@ author = OpenStack author-email = [email protected] home-page = https://docs.openstack.org/oslo.vmware/latest/ +python-requires = >=3.6 classifier = Environment :: OpenStack Intended Audience :: Information Technology @@ -13,11 +14,11 @@ License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: Implementation :: CPython [files] packages = @@ -37,9 +38,6 @@ mapping_file = babel.cfg output_file = oslo_vmware/locale/oslo_vmware.pot -[wheel] -universal = 1 - [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/setup.py new/oslo.vmware-3.3.1/setup.py --- old/oslo.vmware-2.34.1/setup.py 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/setup.py 2020-04-07 12:12:11.000000000 +0200 @@ -13,17 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT import setuptools -# In python < 2.7.4, a lazy loading of package `pbr` will break -# setuptools if some other modules registered functions in `atexit`. -# solution from: http://bugs.python.org/issue15881#msg170215 -try: - import multiprocessing # noqa -except ImportError: - pass - setuptools.setup( setup_requires=['pbr>=2.0.0'], pbr=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/test-requirements.txt new/oslo.vmware-3.3.1/test-requirements.txt --- old/oslo.vmware-2.34.1/test-requirements.txt 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/test-requirements.txt 2020-04-07 12:12:11.000000000 +0200 @@ -3,10 +3,9 @@ # process, which may cause wedges in the gate later. # Hacking already pins down pep8, pyflakes and flake8 -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=3.0,<3.1.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -mock>=2.0.0 # BSD testtools>=2.2.0 # MIT stestr>=2.0.0 # Apache-2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.vmware-2.34.1/tox.ini new/oslo.vmware-3.3.1/tox.ini --- old/oslo.vmware-2.34.1/tox.ini 2019-09-04 16:25:00.000000000 +0200 +++ new/oslo.vmware-3.3.1/tox.ini 2020-04-07 12:12:11.000000000 +0200 @@ -1,9 +1,10 @@ [tox] -minversion = 2.0 -envlist = py27,py37,pep8 +minversion = 3.2.0 +envlist = py37,pep8 +ignore_basepython_conflict = true [testenv] -install_command = pip install {opts} {packages} +basepython = python3 whitelist_externals = find deps = @@ -13,18 +14,15 @@ commands = stestr run --slowest {posargs} [testenv:pep8] -basepython = python3 commands = flake8 # Run security linter bandit -r oslo_vmware [testenv:bandit] -basepython = python3 commands = bandit -r oslo_vmware [testenv:docs] -basepython = python3 whitelist_externals = rm deps = @@ -32,10 +30,9 @@ -r{toxinidir}/doc/requirements.txt commands = rm -rf doc/build doc/source/reference/api - sphinx-build -W -b html doc/source doc/build/html + sphinx-build -W --keep-going -b html doc/source doc/build/html [testenv:cover] -basepython = python3 commands = coverage erase find . -type f -name "*.pyc" -delete @@ -43,29 +40,35 @@ coverage report [testenv:venv] -basepython = python3 commands = {posargs} [flake8] show-source = True -ignore = H405 +# H405: multi line docstring summary not separated with an empty line +# W504 line break after binary operator +ignore = H405,W504 exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,__init__.py [hacking] import_exceptions = oslo_vmware.tests.base tests.base -local-check-factory = oslo_vmware.hacking.checks.factory + +[flake8:local-plugins] +extension = + N537 = checks:no_translate_logs +paths = ./oslo_vmware/hacking [testenv:releasenotes] -basepython = python3 +whitelist_externals = rm deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} -r{toxinidir}/doc/requirements.txt -commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html +commands = + rm -rf releasenotes/build + sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html [testenv:bindep] -basepython = python3 # Do not install any requirements. We want this to be fast and work even if # system dependencies are missing, since it's used to tell you what system # dependencies are missing! This also means that bindep must be installed @@ -75,7 +78,6 @@ commands = bindep test [testenv:lower-constraints] -basepython = python3 deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt
