From 5a949e0cb836078312d79784c53e29fae41adb83 Mon Sep 17 00:00:00 2001 From: OpenStack Release Bot Date: Fri, 4 Mar 2022 17:20:34 +0000 Subject: [PATCH 1/8] Update master for stable/yoga Add file to the reno documentation build to show release notes for stable/yoga. Use pbr instruction to increment the minor version number automatically so that master versions are higher than the versions on stable/yoga. Sem-Ver: feature Change-Id: I376bba8692bd6befa53057ab2110dd74458092b2 --- releasenotes/source/index.rst | 1 + releasenotes/source/yoga.rst | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 releasenotes/source/yoga.rst diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst index 7200d32..d5b7011 100644 --- a/releasenotes/source/index.rst +++ b/releasenotes/source/index.rst @@ -6,6 +6,7 @@ :maxdepth: 1 unreleased + yoga xena wallaby victoria diff --git a/releasenotes/source/yoga.rst b/releasenotes/source/yoga.rst new file mode 100644 index 0000000..7cd5e90 --- /dev/null +++ b/releasenotes/source/yoga.rst @@ -0,0 +1,6 @@ +========================= +Yoga Series Release Notes +========================= + +.. release-notes:: + :branch: stable/yoga -- GitLab From 6dd22edc80f7495e32d61eb78e4e48f07bb78f44 Mon Sep 17 00:00:00 2001 From: OpenStack Release Bot Date: Fri, 4 Mar 2022 17:20:36 +0000 Subject: [PATCH 2/8] Add Python3 zed unit tests This is an automatically generated patch to ensure unit testing is in place for all the of the tested runtimes for zed. See also the PTI in governance [1]. [1]: https://governance.openstack.org/tc/reference/project-testing-interface.html Change-Id: I0df16337c74ac0087b35293e189441656a2bafa8 --- .zuul.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zuul.yaml b/.zuul.yaml index a9c3823..ec981aa 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -2,6 +2,6 @@ templates: - check-requirements - lib-forward-testing-python3 - - openstack-python3-yoga-jobs + - openstack-python3-zed-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 -- GitLab From 54a96f50c87853f619e90d3ea2ad82d0979740e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Thu, 5 May 2022 11:43:57 +0200 Subject: [PATCH 3/8] Drop python3.6/3.7 support in testing runtime In Zed cycle testing runtime, we are targetting to drop the python 3.6/3.7 support, project started adding python 3.8 as minimum, example nova: - https://github.com/openstack/nova/blob/56b5aed08c6a3ed81b78dc216f0165ebfe3c3350/setup.cfg#L13 also indicate that we support py3.9. Change-Id: I717b0e4ea1c450d4cb7af7366e813e58b5d531e5 --- setup.cfg | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 1f6663a..2ee4702 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ description_file = author = OpenStack author_email = openstack-discuss@lists.openstack.org home_page = https://docs.openstack.org/oslo.vmware/latest/ -python_requires = >=3.6 +python_requires = >=3.8 classifier = Environment :: OpenStack Intended Audience :: Information Technology @@ -15,9 +15,8 @@ classifier = Operating System :: POSIX :: Linux Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 Programming Language :: Python :: 3 :: Only Programming Language :: Python :: Implementation :: CPython -- GitLab From 42ca5ddb2660227269ae1e9ce5642338e55304f0 Mon Sep 17 00:00:00 2001 From: Fabian Wiesel Date: Tue, 24 May 2022 19:45:15 +0000 Subject: [PATCH 4/8] Download ISO in more simple way. In order to add support of transferring an ISO from one datastore to another, below changes are done: - Return and close connection for read_connection - Add FileReadHandle similar to FileWriteHandle - Add common headers to _create_connection - Accept pre-build cookie for FileReadHandle/FileWriteHandle - DatastoreUrl as parameter for FileReadHandle/FileWriteHandle Closes-bug: #1975618 Change-Id: I311c98201e3a89db561b7a0c64592803b32a8b31 --- oslo_vmware/rw_handles.py | 137 ++++++++++++++++++++++++++++++-------- 1 file changed, 108 insertions(+), 29 deletions(-) diff --git a/oslo_vmware/rw_handles.py b/oslo_vmware/rw_handles.py index a7b3e72..e988f2f 100644 --- a/oslo_vmware/rw_handles.py +++ b/oslo_vmware/rw_handles.py @@ -60,7 +60,7 @@ class FileHandle(object): self._file_handle = file_handle def _create_connection(self, url, method, cacerts=False, - ssl_thumbprint=None): + ssl_thumbprint=None, cookies=None): _urlparse = urlparse.urlparse(url) scheme, netloc, path, params, query, fragment = _urlparse if scheme == 'http': @@ -88,18 +88,20 @@ class FileHandle(object): if query: path = path + '?' + query conn.putrequest(method, path) + conn.putheader('User-Agent', USER_AGENT) + if cookies: + vim_cookie = self._build_vim_cookie_header(cookies) + conn.putheader('Cookie', vim_cookie) return conn def _create_read_connection(self, url, cookies=None, cacerts=False, ssl_thumbprint=None): LOG.debug("Opening URL: %s for reading.", url) try: - conn = self._create_connection(url, 'GET', cacerts, ssl_thumbprint) - vim_cookie = self._build_vim_cookie_header(cookies) - conn.putheader('User-Agent', USER_AGENT) - conn.putheader('Cookie', vim_cookie) + conn = self._create_connection(url, 'GET', cacerts, ssl_thumbprint, + cookies=cookies) conn.endheaders() - return conn.getresponse() + return conn except Exception as excep: # TODO(vbala) We need to catch and raise specific exceptions # related to connection problems, invalid request and invalid @@ -123,19 +125,13 @@ class FileHandle(object): 'url': url}) try: conn = self._create_connection(url, method, cacerts, - ssl_thumbprint) - headers = {'User-Agent': USER_AGENT} + ssl_thumbprint, cookies=cookies) if file_size: - headers.update({'Content-Length': str(file_size)}) + conn.putheader('Content-Length', str(file_size)) if overwrite: - headers.update({'Overwrite': overwrite}) - if cookies: - headers.update({'Cookie': - self._build_vim_cookie_header(cookies)}) + conn.putheader('Overwrite', overwrite) if content_type: - headers.update({'Content-Type': content_type}) - for key, value in headers.items(): - conn.putheader(key, value) + conn.putheader('Content-Type', content_type) conn.endheaders() return conn except requests.RequestException as excep: @@ -154,11 +150,12 @@ class FileHandle(object): def _build_vim_cookie_header(self, vim_cookies): """Build ESX host session cookie header.""" - cookie_header = "" + # As returned from DatastoreURL.get_transfer_ticket + if isinstance(vim_cookies, str): + return vim_cookies for vim_cookie in vim_cookies: - cookie_header = vim_cookie.name + '=' + vim_cookie.value - break - return cookie_header + return vim_cookie.name + '=' + vim_cookie.value + return "" def write(self, data): """Write data to the file. @@ -219,17 +216,21 @@ class FileHandle(object): class FileWriteHandle(FileHandle): """Write handle for a file in VMware server.""" - def __init__(self, host, port, data_center_name, datastore_name, cookies, - file_path, file_size, scheme='https', cacerts=False, + def __init__(self, host_or_url, port=None, data_center_name=None, + datastore_name=None, cookies=None, file_path=None, + file_size=None, scheme='https', cacerts=False, thumbprint=None): """Initializes the write handle with given parameters. - :param host: ESX/VC server IP address or host name + :param host_or_url: ESX/VC server IP address or host name or a complete + DatastoreURL :param port: port for connection :param data_center_name: name of the data center in the case of a VC server :param datastore_name: name of the datastore where the file is stored - :param cookies: cookies to build the vim cookie header + :param cookies: cookies to build the vim cookie header, or a string + with the prebuild vim cookie header + (See: DatastoreURL.get_transfer_ticket()) :param file_path: datastore path where the file is written :param file_size: size of the file in bytes :param scheme: protocol-- http or https @@ -237,10 +238,13 @@ class FileWriteHandle(FileHandle): :param thumbprint: expected SHA1 thumbprint of server's certificate :raises: VimConnectionException, ValueError """ - soap_url = self._get_soap_url(scheme, host, port) - param_list = {'dcPath': data_center_name, 'dsName': datastore_name} - self._url = '%s/folder/%s' % (soap_url, file_path) - self._url = self._url + '?' + urlparse.urlencode(param_list) + if not port and not data_center_name and not datastore_name: + self._url = host_or_url + else: + soap_url = self._get_soap_url(scheme, host_or_url, port) + param_list = {'dcPath': data_center_name, 'dsName': datastore_name} + self._url = '%s/folder/%s' % (soap_url, file_path) + self._url = self._url + '?' + urlparse.urlencode(param_list) self._conn = self._create_write_connection('PUT', self._url, @@ -286,6 +290,79 @@ class FileWriteHandle(FileHandle): return "File write handle for %s" % self._url +class FileReadHandle(FileHandle): + """Read handle for a file in VMware server.""" + + def __init__(self, host_or_url, port=None, data_center_name=None, + datastore_name=None, cookies=None, + file_path=None, scheme='https', cacerts=False, + thumbprint=None): + """Initializes the read handle with given parameters. + + :param host_or_url: ESX/VC server IP address or host name or a complete + DatastoreURL + :param port: port for connection + :param data_center_name: name of the data center in the case of a VC + server + :param datastore_name: name of the datastore where the file is stored + :param cookies: cookies to build the vim cookie header, or a string + with the prebuild vim cookie header + (See: DatastoreURL.get_transfer_ticket()) + :param file_path: datastore path where the file is written + :param scheme: protocol-- http or https + :param cacerts: CA bundle file to use for SSL verification + :param thumbprint: expected SHA1 thumbprint of server's certificate + :raises: VimConnectionException, ValueError + """ + if not port and not data_center_name and not datastore_name: + self._url = host_or_url + else: + soap_url = self._get_soap_url(scheme, host_or_url, port) + param_list = {'dcPath': data_center_name, 'dsName': datastore_name} + self._url = '%s/folder/%s' % (soap_url, file_path) + self._url = self._url + '?' + urlparse.urlencode(param_list) + + self._conn = self._create_read_connection(self._url, + cookies=cookies, + cacerts=cacerts, + ssl_thumbprint=thumbprint) + FileHandle.__init__(self, self._conn.getresponse()) + + def read(self, length): + """Read data from the file. + :param length: amount of data to be read + :raises: VimConnectionException, VimException + """ + try: + return self._file_handle.read(length) + except requests.RequestException as excep: + excep_msg = _("Connection error occurred while reading data from" + " %s.") % self._url + LOG.exception(excep_msg) + raise exceptions.VimConnectionException(excep_msg, excep) + except Exception as excep: + # TODO(vbala) We need to catch and raise specific exceptions + # related to connection problems, invalid request and invalid + # arguments. + excep_msg = _("Error occurred while writing data to" + " %s.") % self._url + LOG.exception(excep_msg) + raise exceptions.VimException(excep_msg, excep) + + def close(self): + """Closes the connection. + """ + self._conn.close() + super(FileReadHandle, self).close() + LOG.debug("Closed File read handle for %s.", self._url) + + def get_size(self): + return self._file_handle.getheader('Content-Length') + + def __str__(self): + return "File read handle for %s" % self._url + + class VmdkHandle(FileHandle): """VMDK handle based on HttpNfcLease.""" @@ -608,7 +685,8 @@ class VmdkReadHandle(VmdkHandle): self._conn = self._create_read_connection(url, cookies=cookies, ssl_thumbprint=thumbprint) - super(VmdkReadHandle, self).__init__(session, lease, url, self._conn) + super(VmdkReadHandle, self).__init__(session, lease, url, + self._conn.getresponse()) def read(self, chunk_size=READ_CHUNKSIZE): """Read a chunk of data from the VMDK file. @@ -639,6 +717,7 @@ class VmdkReadHandle(VmdkHandle): :raises: VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException """ + self._conn.close() try: self._release_lease() except exceptions.ManagedObjectNotFoundException: -- GitLab From 8af09e9907eed113eed559a101cad422f9b0615e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Fri, 27 May 2022 12:17:16 +0200 Subject: [PATCH 5/8] Fix formatting of release list Change-Id: Idd4b4a54c34ce9982f805bc02e5b980bcb9b129b --- releasenotes/source/index.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst index d5b7011..0da24e2 100644 --- a/releasenotes/source/index.rst +++ b/releasenotes/source/index.rst @@ -2,19 +2,19 @@ oslo.vmware Release Notes =========================== - .. toctree:: - :maxdepth: 1 +.. toctree:: + :maxdepth: 1 - unreleased - yoga - xena - wallaby - victoria - ussuri - train - stein - rocky - queens - pike - ocata - newton + unreleased + yoga + xena + wallaby + victoria + ussuri + train + stein + rocky + queens + pike + ocata + newton -- GitLab From 9be0de02611af4cf198c7f983841a3e9325e95ef Mon Sep 17 00:00:00 2001 From: OpenStack Proposal Bot Date: Tue, 21 Jun 2022 03:57:26 +0000 Subject: [PATCH 6/8] Imported Translations from Zanata For more information about this automatic import see: https://docs.openstack.org/i18n/latest/reviewing-translation-import.html Change-Id: I3e91bbb1507d1a502125ba8cb65a39263e306837 --- .../locale/en_GB/LC_MESSAGES/releasenotes.po | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po b/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po index 2e1db4a..fd8edda 100644 --- a/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po +++ b/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po @@ -2,15 +2,16 @@ # Andi Chandler , 2017. #zanata # Andi Chandler , 2018. #zanata # Andi Chandler , 2020. #zanata +# Andi Chandler , 2022. #zanata msgid "" msgstr "" "Project-Id-Version: oslo.vmware Release Notes\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-22 12:46+0000\n" +"POT-Creation-Date: 2022-05-11 15:56+0000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2020-10-10 02:29+0000\n" +"PO-Revision-Date: 2022-06-10 09:18+0000\n" "Last-Translator: Andi Chandler \n" "Language-Team: English (United Kingdom)\n" "Language: en_GB\n" @@ -103,6 +104,15 @@ msgstr "Ussuri Series Release Notes" msgid "Victoria Series Release Notes" msgstr "Victoria Series Release Notes" +msgid "Wallaby Series Release Notes" +msgstr "Wallaby Series Release Notes" + +msgid "Xena Series Release Notes" +msgstr "Xena Series Release Notes" + +msgid "Yoga Series Release Notes" +msgstr "Yoga Series Release Notes" + msgid "" "``ManagedObjectReference``'s ``value`` and ``_type`` attributes must not be " "used anymore in depending projects. Instead, ``vim_util.get_moref_value()`` " -- GitLab From 456db41c33eff3f9a14f764c3b40b8531fc26b3e Mon Sep 17 00:00:00 2001 From: OpenStack Proposal Bot Date: Wed, 6 Jul 2022 03:56:41 +0000 Subject: [PATCH 7/8] Imported Translations from Zanata For more information about this automatic import see: https://docs.openstack.org/i18n/latest/reviewing-translation-import.html Change-Id: I7286ea54a4ca641d5a2187ad5c884bc8fc8276fc --- oslo_vmware/locale/en_GB/LC_MESSAGES/oslo_vmware.po | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/oslo_vmware/locale/en_GB/LC_MESSAGES/oslo_vmware.po b/oslo_vmware/locale/en_GB/LC_MESSAGES/oslo_vmware.po index e03de05..8d2d5e5 100644 --- a/oslo_vmware/locale/en_GB/LC_MESSAGES/oslo_vmware.po +++ b/oslo_vmware/locale/en_GB/LC_MESSAGES/oslo_vmware.po @@ -2,15 +2,16 @@ # Andreas Jaeger , 2016. #zanata # Andi Chandler , 2017. #zanata # Andi Chandler , 2020. #zanata +# Andi Chandler , 2022. #zanata msgid "" msgstr "" "Project-Id-Version: oslo.vmware VERSION\n" "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" -"POT-Creation-Date: 2020-09-22 12:46+0000\n" +"POT-Creation-Date: 2022-06-21 16:36+0000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2020-10-10 02:29+0000\n" +"PO-Revision-Date: 2022-07-05 09:38+0000\n" "Last-Translator: Andi Chandler \n" "Language-Team: English (United Kingdom)\n" "Language: en_GB\n" @@ -26,6 +27,10 @@ msgstr "Cannot delete file." msgid "Capacity is smaller than free space" msgstr "Capacity is smaller than free space" +#, python-format +msgid "Connection error occurred while reading data from %s." +msgstr "Connection error occurred while reading data from %s." + #, python-format msgid "Connection error occurred while writing data to %s." msgstr "Connection error occurred while writing data to %s." -- GitLab From 968f8cc8df14e91748409353937f85ca17030770 Mon Sep 17 00:00:00 2001 From: niuke Date: Thu, 28 Jul 2022 13:33:49 +0800 Subject: [PATCH 8/8] remove unicode literal from code Change-Id: I2a0271618074ceb68fed716da347ad5fde217a28 --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index cc97524..f187096 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -33,7 +33,7 @@ openstackdocs_bug_tag = '' master_doc = 'index' # General information about the project. -copyright = u'2014, OpenStack Foundation' +copyright = '2014, OpenStack Foundation' # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True -- GitLab