Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-sushy for openSUSE:Factory checked in at 2024-01-04 15:59:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-sushy (Old) and /work/SRC/openSUSE:Factory/.python-sushy.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-sushy" Thu Jan 4 15:59:17 2024 rev:15 rq:1136721 version:4.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-sushy/python-sushy.changes 2023-12-01 21:27:38.110875507 +0100 +++ /work/SRC/openSUSE:Factory/.python-sushy.new.28375/python-sushy.changes 2024-01-04 16:01:22.517237579 +0100 @@ -1,0 +2,9 @@ +Thu Jan 4 09:03:59 UTC 2024 - cloud-de...@suse.de + +- update to version 4.7.0 + - Fix missing ETag when patching Redfish resource + - Update master for stable/2023.2 + - Adds an option for setting the http boot uri + - Fix wrong _get_registry logic in ResourceBase + +------------------------------------------------------------------- Old: ---- sushy-4.5.1.tar.gz New: ---- sushy-4.7.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-sushy.spec ++++++ --- /var/tmp/diff_new_pack.25C0u1/_old 2024-01-04 16:01:23.197262420 +0100 +++ /var/tmp/diff_new_pack.25C0u1/_new 2024-01-04 16:01:23.201262567 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-sushy # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 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-sushy -Version: 4.5.1 +Version: 4.7.0 Release: 0 Summary: Python library to communicate with Redfish based systems License: Apache-2.0 Group: Development/Languages/Python URL: https://docs.openstack.org/sushy -Source0: https://files.pythonhosted.org/packages/source/s/sushy/sushy-4.5.1.tar.gz +Source0: https://files.pythonhosted.org/packages/source/s/sushy/sushy-4.7.0.tar.gz BuildRequires: openstack-macros BuildRequires: python3-oslotest BuildRequires: python3-pbr >= 2.0.0 @@ -62,7 +62,7 @@ This package contains the documentation. %prep -%autosetup -p1 -n sushy-4.5.1 +%autosetup -p1 -n sushy-4.7.0 %py_req_cleanup %build ++++++ sushy-4.5.1.tar.gz -> sushy-4.7.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/AUTHORS new/sushy-4.7.0/AUTHORS --- old/sushy-4.5.1/AUTHORS 2023-08-24 10:59:33.000000000 +0200 +++ new/sushy-4.7.0/AUTHORS 2023-11-23 10:43:02.000000000 +0100 @@ -51,6 +51,7 @@ Steve Baker <sba...@redhat.com> Takashi Natsume <takanat...@gmail.com> Thomas Goirand <z...@debian.org> +Vanou Ishii <ishii.va...@fujitsu.com> Varsha <varsha.verma.ee...@itbhu.ac.in> Vu Cong Tuan <tua...@vn.fujitsu.com> Yusef Shaban <ysha...@godaddy.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/ChangeLog new/sushy-4.7.0/ChangeLog --- old/sushy-4.5.1/ChangeLog 2023-08-24 10:59:33.000000000 +0200 +++ new/sushy-4.7.0/ChangeLog 2023-11-23 10:43:02.000000000 +0100 @@ -1,6 +1,18 @@ CHANGES ======= +4.7.0 +----- + +* Adds an option for setting the http boot uri + +4.6.0 +----- + +* Fix missing ETag when patching Redfish resource +* Update master for stable/2023.2 +* Fix wrong \_get\_registry logic in ResourceBase + 4.5.1 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/PKG-INFO new/sushy-4.7.0/PKG-INFO --- old/sushy-4.5.1/PKG-INFO 2023-08-24 10:59:33.945420500 +0200 +++ new/sushy-4.7.0/PKG-INFO 2023-11-23 10:43:02.647807600 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: sushy -Version: 4.5.1 +Version: 4.7.0 Summary: Sushy is a small Python library to communicate with Redfish based systems Home-page: https://docs.openstack.org/sushy/latest/ Author: OpenStack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/releasenotes/notes/add-http-boot-uri-support-5c25816e13ccdb27.yaml new/sushy-4.7.0/releasenotes/notes/add-http-boot-uri-support-5c25816e13ccdb27.yaml --- old/sushy-4.5.1/releasenotes/notes/add-http-boot-uri-support-5c25816e13ccdb27.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/sushy-4.7.0/releasenotes/notes/add-http-boot-uri-support-5c25816e13ccdb27.yaml 2023-11-23 10:42:34.000000000 +0100 @@ -0,0 +1,9 @@ +--- +features: + - | + Adds functionality to the ``set_system_boot_options`` method + permitting an ``http_boot_uri`` option to be set. + - | + Adds an ``http_boot_uri`` option to the System boot object, + permitting an API client user to view what the BMC's + redfish ``HttpBootUri`` setting is. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/releasenotes/notes/fix-missing-etags-ded8c0bb31fafef7.yaml new/sushy-4.7.0/releasenotes/notes/fix-missing-etags-ded8c0bb31fafef7.yaml --- old/sushy-4.5.1/releasenotes/notes/fix-missing-etags-ded8c0bb31fafef7.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/sushy-4.7.0/releasenotes/notes/fix-missing-etags-ded8c0bb31fafef7.yaml 2023-11-23 10:42:34.000000000 +0100 @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes missing ETag in PATCH operation against Redfish resources with + backward compatibility for Redfish implementation which doesn't work + with ETag in header. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/releasenotes/source/2023.2.rst new/sushy-4.7.0/releasenotes/source/2023.2.rst --- old/sushy-4.5.1/releasenotes/source/2023.2.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/sushy-4.7.0/releasenotes/source/2023.2.rst 2023-11-23 10:42:34.000000000 +0100 @@ -0,0 +1,6 @@ +=========================== +2023.2 Series Release Notes +=========================== + +.. release-notes:: + :branch: stable/2023.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/releasenotes/source/index.rst new/sushy-4.7.0/releasenotes/source/index.rst --- old/sushy-4.5.1/releasenotes/source/index.rst 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/releasenotes/source/index.rst 2023-11-23 10:42:34.000000000 +0100 @@ -6,6 +6,7 @@ :maxdepth: 1 unreleased + 2023.2 2023.1 zed yoga diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/resources/base.py new/sushy-4.7.0/sushy/resources/base.py --- old/sushy-4.5.1/sushy/resources/base.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/resources/base.py 2023-11-23 10:42:34.000000000 +0100 @@ -593,7 +593,7 @@ for key, registry in registries.items(): if (registry - and self._attribute_registry in (key, registry.identity)): + and identity in (key, registry.identity)): # NOTE(iurygregory): some registries may have "en-US" # as their language, in this case we can check if the # registry language starts with the requested language. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/resources/chassis/chassis.py new/sushy-4.7.0/sushy/resources/chassis/chassis.py --- old/sushy-4.5.1/sushy/resources/chassis/chassis.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/resources/chassis/chassis.py 2023-11-23 10:42:34.000000000 +0100 @@ -214,9 +214,10 @@ parameter='state', value=state, valid_values=' ,'.join(i.value for i in res_cons.IndicatorLED)) + etag = self._get_etag() data = {'IndicatorLED': state} - self._conn.patch(self.path, data=data) + self._conn.patch(self.path, data=data, etag=etag) self.invalidate() @property diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/resources/manager/virtual_media.py new/sushy-4.7.0/sushy/resources/manager/virtual_media.py --- old/sushy-4.5.1/sushy/resources/manager/virtual_media.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/resources/manager/virtual_media.py 2023-11-23 10:42:34.000000000 +0100 @@ -248,8 +248,10 @@ parameter='verify_certificate', value=verify_certificate, valid_values='boolean (True, False)') + etag = self._get_etag() self._conn.patch(self.path, - data={'VerifyCertificate': verify_certificate}) + data={'VerifyCertificate': verify_certificate}, + etag=etag) self.invalidate() @property diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/resources/settings.py new/sushy-4.7.0/sushy/resources/settings.py --- old/sushy-4.5.1/sushy/resources/settings.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/resources/settings.py 2023-11-23 10:42:34.000000000 +0100 @@ -170,7 +170,7 @@ :returns: Response object """ - return connector.patch(self.resource_uri, data=value) + return connector.patch(self.resource_uri, data=value, etag=self._etag) @property def resource_uri(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/resources/system/bios.py new/sushy-4.7.0/sushy/resources/system/bios.py --- old/sushy-4.5.1/sushy/resources/system/bios.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/resources/system/bios.py 2023-11-23 10:42:34.000000000 +0100 @@ -149,6 +149,10 @@ payload = utils.process_apply_time_input( payload, apply_time, maint_window_start_time, maint_window_duration) + # NOTE(vanou): To retrieve current ETag value of @Redfish.Settings + # but not update cached _pending_settings_resource, because cached + # property is only this one and re-cache is not required + self.refresh(force=False) self._settings.commit(self._conn, payload) utils.cache_clear(self, force_refresh=False, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/resources/system/secure_boot.py new/sushy-4.7.0/sushy/resources/system/secure_boot.py --- old/sushy-4.5.1/sushy/resources/system/secure_boot.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/resources/system/secure_boot.py 2023-11-23 10:42:34.000000000 +0100 @@ -144,4 +144,6 @@ raise exceptions.InvalidParameterValueError( "Expected a boolean for 'enabled', got %r" % enabled) - self._conn.patch(self.path, data={'SecureBootEnable': enabled}) + etag = self._get_etag() + self._conn.patch(self.path, data={'SecureBootEnable': enabled}, + etag=etag) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/resources/system/storage/controller.py new/sushy-4.7.0/sushy/resources/system/storage/controller.py --- old/sushy-4.5.1/sushy/resources/system/storage/controller.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/resources/system/storage/controller.py 2023-11-23 10:42:34.000000000 +0100 @@ -97,6 +97,10 @@ payload = utils.process_apply_time_input( payload, apply_time, maint_window_start_time, maint_window_duration) + # NOTE(vanou): To retrieve current ETag value of @Redfish.Settings + # but not update cached pending_settings, because cached property is + # only this one and re-cache this is not required + self.refresh(force=False) r = self._settings.commit(self._conn, payload) utils.cache_clear(self, force_refresh=False, only_these=['pending_settings']) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/resources/system/storage/drive.py new/sushy-4.7.0/sushy/resources/system/storage/drive.py --- old/sushy-4.5.1/sushy/resources/system/storage/drive.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/resources/system/storage/drive.py 2023-11-23 10:42:34.000000000 +0100 @@ -102,7 +102,8 @@ parameter='state', value=state, valid_values=' ,'.join(i.value for i in res_cons.IndicatorLED)) + etag = self._get_etag() data = {'IndicatorLED': state} - self._conn.patch(self.path, data=data) + self._conn.patch(self.path, data=data, etag=etag) self.invalidate() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/resources/system/system.py new/sushy-4.7.0/sushy/resources/system/system.py --- old/sushy-4.5.1/sushy/resources/system/system.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/resources/system/system.py 2023-11-23 10:42:34.000000000 +0100 @@ -56,6 +56,8 @@ target = base.MappedField('BootSourceOverrideTarget', sys_cons.BootSource) + http_boot_uri = base.Field('HttpBootUri') + class MemorySummaryField(base.CompositeField): health = base.Field(['Status', 'HealthRollup']) @@ -212,7 +214,8 @@ return {v for v in sys_cons.BootSource if v.value in self.boot.allowed_values} - def set_system_boot_options(self, target=None, enabled=None, mode=None): + def set_system_boot_options(self, target=None, enabled=None, mode=None, + http_boot_uri=None): """Set boot source and/or boot frequency and/or boot mode. Set the boot source and/or boot frequency and/or boot mode to use @@ -220,10 +223,19 @@ :param target: The target boot source, a :py:class:`sushy.BootSource` value. Optional. - :param enabled: How long the override be enabled, + :param enabled: How long the override is enabled, a :py:class:`sushy.BootSourceOverrideEnabled` value. Optional. :param mode: The boot mode, a :py:class:`sushy.BootSourceOverrideMode` value. Optional. + :param http_boot_uri: The requested HTTP Boot URI to transmit to the + BMC. Only valid when BootSourceOverrideTarget is set to UefiHTTP, + when utilizing the ``target`` parameter. If no value is supplied, + and the target is set to UefiHTTP, then an empty value will be + sent to the BMC to remove any prior setting, allowing the host + to load configuration from DHCP. + If not explicitly set, any value will be removed from a BMC when + UefiHttp boot is not engaged. + :raises: InvalidParameterValueError, if any information passed is invalid. """ @@ -235,6 +247,7 @@ settings_boot_section = settings_resp.json().get('Boot', {}) else: settings_resp = None + settings_boot_section = {} if target is not None: valid_targets = self.get_allowed_system_boot_source_values() @@ -293,6 +306,25 @@ else: data['Boot']['BootSourceOverrideMode'] = fishy_mode + if target == sys_cons.BootSource.UEFI_HTTP: + # The http_boot_uri value *can* be set independently of the + # target, but the BMC will just ignore it unless the target + # is set. So we should only, and explicitly set it when we've + # been requested to boot from UefiHTTP. + if not http_boot_uri: + # This should clear out any old entries, as no URI translates + # to the intent of "use whatever the dhcp server says". + data['Boot']['HttpBootUri'] = None + else: + # Explicilty set the URI. + data['Boot']['HttpBootUri'] = http_boot_uri + elif not http_boot_uri: + # We're not doing boot from URL, we should cleanup any setting + # which may be from a prior step/call. + if settings_boot_section.get('HttpBootUri'): + # If the setting is present, and has any value, unset it. + data['Boot']['HttpBootUri'] = None + # TODO(lucasagomes): Check the return code and response body ? # Probably we should call refresh() as well. if settings_data.get('Boot'): @@ -342,9 +374,10 @@ parameter='state', value=state, valid_values=' ,'.join(i.value for i in res_cons.IndicatorLED)) + etag = self._get_etag() data = {'IndicatorLED': state} - self._conn.patch(self.path, data=data) + self._conn.patch(self.path, data=data, etag=etag) self.invalidate() def _get_processor_collection_path(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/tests/unit/json_samples/system.json new/sushy-4.7.0/sushy/tests/unit/json_samples/system.json --- old/sushy-4.5.1/sushy/tests/unit/json_samples/system.json 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/tests/unit/json_samples/system.json 2023-11-23 10:42:34.000000000 +0100 @@ -36,10 +36,12 @@ "Utilities", "Diags", "SDCard", - "UefiTarget" + "UefiTarget", + "UefiHttp" ], "BootSourceOverrideMode": "UEFI", - "UefiTargetBootSourceOverride": "/0x31/0x33/0x01/0x01" + "UefiTargetBootSourceOverride": "/0x31/0x33/0x01/0x01", + "HttpBootUri": "https://Contoso.lan/boot.iso" }, "TrustedModules": [ { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/tests/unit/resources/chassis/test_chassis.py new/sushy-4.7.0/sushy/tests/unit/resources/chassis/test_chassis.py --- old/sushy-4.5.1/sushy/tests/unit/resources/chassis/test_chassis.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/tests/unit/resources/chassis/test_chassis.py 2023-11-23 10:42:34.000000000 +0100 @@ -34,6 +34,7 @@ self.json_doc = json.load(f) self.conn.get.return_value.json.return_value = self.json_doc + self.conn.get.return_value.headers = {'ETag': 'd37f7bcd528e4d59'} self.chassis = chassis.Chassis(self.conn, '/redfish/v1/Chassis/Blade1', redfish_version='1.8.0') @@ -144,7 +145,8 @@ self.chassis.set_indicator_led(sushy.IndicatorLED.BLINKING) self.chassis._conn.patch.assert_called_once_with( '/redfish/v1/Chassis/Blade1', - data={'IndicatorLED': 'Blinking'}) + data={'IndicatorLED': 'Blinking'}, + etag='d37f7bcd528e4d59') invalidate_mock.assert_called_once_with() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/tests/unit/resources/manager/test_virtual_media.py new/sushy-4.7.0/sushy/tests/unit/resources/manager/test_virtual_media.py --- old/sushy-4.5.1/sushy/tests/unit/resources/manager/test_virtual_media.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/tests/unit/resources/manager/test_virtual_media.py 2023-11-23 10:42:34.000000000 +0100 @@ -294,13 +294,16 @@ self.assertTrue(self.sys_virtual_media._is_stale) def test_set_verify_certificate(self): + self.conn.get.return_value.headers = {'Allow': 'GET,HEAD', + 'ETag': '3d7b8a7360bf2941d'} with mock.patch.object( self.sys_virtual_media, 'invalidate', autospec=True) as invalidate_mock: self.sys_virtual_media.set_verify_certificate(True) self.sys_virtual_media._conn.patch.assert_called_once_with( "/redfish/v1/Managers/BMC/VirtualMedia/Floppy1", - data={'VerifyCertificate': True}) + data={'VerifyCertificate': True}, + etag='3d7b8a7360bf2941d') invalidate_mock.assert_called_once_with() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/tests/unit/resources/system/storage/test_controller.py new/sushy-4.7.0/sushy/tests/unit/resources/system/storage/test_controller.py --- old/sushy-4.5.1/sushy/tests/unit/resources/system/storage/test_controller.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/tests/unit/resources/system/storage/test_controller.py 2023-11-23 10:42:34.000000000 +0100 @@ -65,6 +65,8 @@ self.controller.supported_apply_times) def test_update(self): + self.conn.get.return_value.json.side_effect = [ + self.json_doc, self.json_doc] mock_response = mock.Mock() mock_response.status_code = http_client.ACCEPTED mock_response.headers = {'Content-Length': 42, @@ -81,7 +83,8 @@ data={'ControllerRates': {'ConsistencyCheckRatePercent': 30}, '@Redfish.SettingsApplyTime': { '@odata.type': '#Settings.v1_0_0.PreferredApplyTime', - 'ApplyTime': 'OnReset'}}) + 'ApplyTime': 'OnReset'}}, + etag=None) self.assertIsInstance(tm, taskmonitor.TaskMonitor) self.assertEqual('/Task/545', tm.task_monitor_uri) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/tests/unit/resources/system/storage/test_drive.py new/sushy-4.7.0/sushy/tests/unit/resources/system/storage/test_drive.py --- old/sushy-4.5.1/sushy/tests/unit/resources/system/storage/test_drive.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/tests/unit/resources/system/storage/test_drive.py 2023-11-23 10:42:34.000000000 +0100 @@ -83,13 +83,15 @@ self.assertEqual('3', volumes[1].identity) def test_set_indicator_led(self): + self.conn.get.return_value.headers = {'ETag': 'a3b01b63f80a4913'} with mock.patch.object( self.stor_drive, 'invalidate', autospec=True) as invalidate_mock: self.stor_drive.set_indicator_led(sushy.IndicatorLED.BLINKING) self.stor_drive._conn.patch.assert_called_once_with( '/redfish/v1/Systems/437XR1138/Storage/1/Drives/' - '32ADF365C6C1B7BD', data={'IndicatorLED': 'Blinking'}) + '32ADF365C6C1B7BD', data={'IndicatorLED': 'Blinking'}, + etag='a3b01b63f80a4913') invalidate_mock.assert_called_once_with() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/tests/unit/resources/system/test_bios.py new/sushy-4.7.0/sushy/tests/unit/resources/system/test_bios.py --- old/sushy-4.5.1/sushy/tests/unit/resources/system/test_bios.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/tests/unit/resources/system/test_bios.py 2023-11-23 10:42:34.000000000 +0100 @@ -119,6 +119,10 @@ attributes.get('maintenance_window')) def test_set_attribute_apply_time(self): + self.conn.get.return_value.json.side_effect = [ + self.bios_json, + self.bios_json] + self.sys_bios.set_attribute( 'ProcTurboMode', 'Disabled', res_cons.ApplyTime.IN_MAINTENANCE_WINDOW_ON_RESET, @@ -131,9 +135,15 @@ '@odata.type': '#Settings.v1_0_0.PreferredApplyTime', 'ApplyTime': 'InMaintenanceWindowOnReset', 'MaintenanceWindowStartTime': '2020-09-01T04:30:00', - 'MaintenanceWindowDurationInSeconds': 600}}) + 'MaintenanceWindowDurationInSeconds': 600}}, + etag='9234ac83b9700123cc32') def test_set_attribute_on_refresh(self): + self.conn.get.return_value.json.side_effect = [ + self.bios_settings_json, + self.bios_json, + self.bios_settings_json] + self.conn.get.reset_mock() # make it to instantiate pending attributes self.sys_bios.pending_attributes @@ -150,6 +160,9 @@ self.assertTrue(self.conn.get.called) def test_set_attributes(self): + self.conn.get.return_value.json.side_effect = [ + self.bios_json] + self.sys_bios.set_attributes( {'ProcTurboMode': 'Disabled', 'UsbControl': 'UsbDisabled'}, res_cons.ApplyTime.AT_MAINTENANCE_WINDOW_START, @@ -163,9 +176,15 @@ '@odata.type': '#Settings.v1_0_0.PreferredApplyTime', 'ApplyTime': 'AtMaintenanceWindowStart', 'MaintenanceWindowStartTime': '2020-09-01T04:30:00', - 'MaintenanceWindowDurationInSeconds': 600}}) + 'MaintenanceWindowDurationInSeconds': 600}}, + etag='9234ac83b9700123cc32') def test_set_attributes_on_refresh(self): + self.conn.get.return_value.json.side_effect = [ + self.bios_settings_json, + self.bios_json, + self.bios_settings_json] + self.conn.get.reset_mock() # make it to instantiate pending attributes self.sys_bios.pending_attributes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/tests/unit/resources/system/test_secure_boot.py new/sushy-4.7.0/sushy/tests/unit/resources/system/test_secure_boot.py --- old/sushy-4.5.1/sushy/tests/unit/resources/system/test_secure_boot.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/tests/unit/resources/system/test_secure_boot.py 2023-11-23 10:42:34.000000000 +0100 @@ -29,6 +29,7 @@ self.secure_boot_json = json.load(f) self.conn.get.return_value.json.return_value = self.secure_boot_json + self.conn.get.return_value.headers = {'ETag': 'b26ae716a2c1f39f'} self.secure_boot = secure_boot.SecureBoot( self.conn, '/redfish/v1/Systems/437XR1138R2/SecureBoot', registries={}, redfish_version='1.1.0') @@ -79,7 +80,8 @@ self.secure_boot.set_enabled(True) self.conn.patch.assert_called_once_with( '/redfish/v1/Systems/437XR1138R2/SecureBoot', - data={'SecureBootEnable': True}) + data={'SecureBootEnable': True}, + etag='b26ae716a2c1f39f') def test_set_enabled_wrong_type(self): self.assertRaises(exceptions.InvalidParameterValueError, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/tests/unit/resources/system/test_system.py new/sushy-4.7.0/sushy/tests/unit/resources/system/test_system.py --- old/sushy-4.5.1/sushy/tests/unit/resources/system/test_system.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/tests/unit/resources/system/test_system.py 2023-11-23 10:42:34.000000000 +0100 @@ -46,6 +46,8 @@ self.sys_inst = system.System( self.conn, '/redfish/v1/Systems/437XR1138R2', redfish_version='1.0.2') + self.sys_inst._get_etag = mock.Mock() + self.sys_inst._get_etag.return_value = '81802dbf61beb0bd' def test__parse_attributes(self): self.sys_inst._parse_attributes(self.json_doc) @@ -243,7 +245,8 @@ sushy.BootSource.UTILITIES, sushy.BootSource.DIAGS, sushy.BootSource.SD_CARD, - sushy.BootSource.UEFI_TARGET]) + sushy.BootSource.UEFI_TARGET, + sushy.BootSource.UEFI_HTTP]) self.assertEqual(expected, values) self.assertIsInstance(values, set) @@ -283,7 +286,7 @@ data={'Boot': {'BootSourceOverrideEnabled': 'Continuous', 'BootSourceOverrideTarget': 'Pxe', 'BootSourceOverrideMode': 'UEFI'}}, - etag=None) + etag='81802dbf61beb0bd') def test_set_system_boot_options_no_mode_specified(self): self.sys_inst.set_system_boot_options( @@ -293,7 +296,7 @@ '/redfish/v1/Systems/437XR1138R2', data={'Boot': {'BootSourceOverrideEnabled': 'Once', 'BootSourceOverrideTarget': 'Hdd'}}, - etag=None) + etag='81802dbf61beb0bd') def test_set_system_boot_options_no_target_specified(self): self.sys_inst.set_system_boot_options( @@ -303,7 +306,7 @@ '/redfish/v1/Systems/437XR1138R2', data={'Boot': {'BootSourceOverrideEnabled': 'Continuous', 'BootSourceOverrideMode': 'UEFI'}}, - etag=None) + etag='81802dbf61beb0bd') def test_set_system_boot_options_no_freq_specified(self): self.sys_inst.set_system_boot_options( @@ -313,7 +316,7 @@ '/redfish/v1/Systems/437XR1138R2', data={'Boot': {'BootSourceOverrideTarget': 'Pxe', 'BootSourceOverrideMode': 'UEFI'}}, - etag=None) + etag='81802dbf61beb0bd') def test_set_system_boot_options_nothing_specified(self): self.sys_inst.set_system_boot_options() @@ -348,7 +351,7 @@ '/redfish/v1/Systems/437XR1138R2', data={'Boot': {'BootSourceOverrideEnabled': 'Once', 'BootSourceOverrideTarget': 'UsbCd'}}, - etag=None) + etag='81802dbf61beb0bd') def test_set_system_boot_options_supermicro_no_usb_cd_boot(self): @@ -361,7 +364,7 @@ '/redfish/v1/Systems/437XR1138R2', data={'Boot': {'BootSourceOverrideEnabled': 'Once', 'BootSourceOverrideTarget': 'Cd'}}, - etag=None) + etag='81802dbf61beb0bd') def test_set_system_boot_options_settings_resource_nokia(self): with open('sushy/tests/unit/json_samples/settings-nokia.json') as f: @@ -477,6 +480,57 @@ data={'Boot': {'BootSourceOverrideMode': 'UEFI'}}, etag='"3d7b838291941d"') + def test_set_system_boot_options_httpbooturi(self): + self.sys_inst.set_system_boot_options( + sushy.BootSource.UEFI_HTTP, + enabled=sushy.BootSourceOverrideEnabled.ONCE, + mode=sushy.BootSourceOverrideMode.UEFI, + http_boot_uri='http://test.lan/test_image.iso' + ) + self.sys_inst._conn.patch.assert_called_once_with( + '/redfish/v1/Systems/437XR1138R2', + data={'Boot': {'BootSourceOverrideTarget': 'UefiHttp', + 'BootSourceOverrideEnabled': 'Once', + 'BootSourceOverrideMode': 'UEFI', + 'HttpBootUri': 'http://test.lan/test_image.iso'}}, + etag=mock.ANY) + + def test_set_system_boot_options_httpboot(self): + self.sys_inst.set_system_boot_options( + sushy.BootSource.UEFI_HTTP, + enabled=sushy.BootSourceOverrideEnabled.ONCE, + mode=sushy.BootSourceOverrideMode.UEFI + ) + self.sys_inst._conn.patch.assert_called_once_with( + '/redfish/v1/Systems/437XR1138R2', + data={'Boot': {'BootSourceOverrideTarget': 'UefiHttp', + 'BootSourceOverrideEnabled': 'Once', + 'BootSourceOverrideMode': 'UEFI', + 'HttpBootUri': None}}, + etag=mock.ANY) + + def test_set_system_boot_options_httpboot_unset(self): + self.sys_inst._settings = mock.Mock() + self.sys_inst._settings.resource_uri = 'meow' + settings_body = json.dumps( + {'Boot': {'HttpBootUri': 'http://foo.bar'}} + ) + + get_settings = mock.MagicMock() + get_settings.json.return_value = settings_body + self.conn.get.side_effect = get_settings + + self.sys_inst.set_system_boot_options( + sushy.BootSource.HDD, + mode=sushy.BootSourceOverrideMode.UEFI + ) + self.sys_inst._conn.patch.assert_called_once_with( + '/redfish/v1/Systems/437XR1138R2', + data={'Boot': {'BootSourceOverrideTarget': 'Hdd', + 'BootSourceOverrideMode': 'UEFI', + 'HttpBootUri': None}}, + etag=mock.ANY) + def test_set_system_boot_source(self): self.sys_inst.set_system_boot_source( sushy.BootSource.PXE, @@ -487,10 +541,10 @@ data={'Boot': {'BootSourceOverrideEnabled': 'Continuous', 'BootSourceOverrideTarget': 'Pxe', 'BootSourceOverrideMode': 'UEFI'}}, - etag=None) + etag='81802dbf61beb0bd') def test_set_system_boot_source_with_etag(self): - self.conn.get.return_value.headers = {'ETag': '"3d7b838291941d"'} + self.conn.get.return_value.headers = {'ETag': '"81802dbf61beb0bd"'} self.sys_inst.set_system_boot_source( sushy.BOOT_SOURCE_TARGET_PXE, enabled=sushy.BOOT_SOURCE_ENABLED_CONTINUOUS, @@ -500,7 +554,7 @@ data={'Boot': {'BootSourceOverrideEnabled': 'Continuous', 'BootSourceOverrideTarget': 'Pxe', 'BootSourceOverrideMode': 'UEFI'}}, - etag='"3d7b838291941d"') + etag="81802dbf61beb0bd") def test_set_system_boot_source_no_mode_specified(self): self.sys_inst.set_system_boot_source( @@ -510,7 +564,17 @@ '/redfish/v1/Systems/437XR1138R2', data={'Boot': {'BootSourceOverrideEnabled': 'Once', 'BootSourceOverrideTarget': 'Hdd'}}, - etag=None) + etag='81802dbf61beb0bd') + + def test_set_system_boot_unsets_http_boot_uri(self): + self.sys_inst.set_system_boot_source( + sushy.BootSource.HDD, + enabled=sushy.BootSourceOverrideEnabled.ONCE) + self.sys_inst._conn.patch.assert_called_once_with( + '/redfish/v1/Systems/437XR1138R2', + data={'Boot': {'BootSourceOverrideEnabled': 'Once', + 'BootSourceOverrideTarget': 'Hdd'}}, + etag=mock.ANY) def test_set_system_boot_source_invalid_target(self): self.assertRaises(exceptions.InvalidParameterValueError, @@ -533,7 +597,8 @@ self.sys_inst.set_indicator_led(sushy.IndicatorLED.BLINKING) self.sys_inst._conn.patch.assert_called_once_with( '/redfish/v1/Systems/437XR1138R2', - data={'IndicatorLED': 'Blinking'}) + data={'IndicatorLED': 'Blinking'}, + etag='81802dbf61beb0bd') invalidate_mock.assert_called_once_with() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy/tests/unit/resources/test_settings.py new/sushy-4.7.0/sushy/tests/unit/resources/test_settings.py --- old/sushy-4.5.1/sushy/tests/unit/resources/test_settings.py 2023-08-24 10:59:02.000000000 +0200 +++ new/sushy-4.7.0/sushy/tests/unit/resources/test_settings.py 2023-11-23 10:42:34.000000000 +0100 @@ -78,7 +78,8 @@ instance.commit(conn, {'Attributes': {'key': 'value'}}) conn.patch.assert_called_once_with( '/redfish/v1/Systems/437XR1138R2/BIOS/Settings', - data={'Attributes': {'key': 'value'}}) + data={'Attributes': {'key': 'value'}}, + etag='9234ac83b9700123cc32') def test_get_status_failure(self): instance = self.settings._load(self.json, mock.Mock()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy.egg-info/PKG-INFO new/sushy-4.7.0/sushy.egg-info/PKG-INFO --- old/sushy-4.5.1/sushy.egg-info/PKG-INFO 2023-08-24 10:59:33.000000000 +0200 +++ new/sushy-4.7.0/sushy.egg-info/PKG-INFO 2023-11-23 10:43:02.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: sushy -Version: 4.5.1 +Version: 4.7.0 Summary: Sushy is a small Python library to communicate with Redfish based systems Home-page: https://docs.openstack.org/sushy/latest/ Author: OpenStack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy.egg-info/SOURCES.txt new/sushy-4.7.0/sushy.egg-info/SOURCES.txt --- old/sushy-4.5.1/sushy.egg-info/SOURCES.txt 2023-08-24 10:59:33.000000000 +0200 +++ new/sushy-4.7.0/sushy.egg-info/SOURCES.txt 2023-11-23 10:43:02.000000000 +0100 @@ -33,6 +33,7 @@ releasenotes/notes/add-drive-volumes-971d80644c3bd1e0.yaml releasenotes/notes/add-endpoint-subresource-to-fabric-b03e5fd99ece1bf4.yaml releasenotes/notes/add-fabric-support-1520f7fcb0e12539.yaml +releasenotes/notes/add-http-boot-uri-support-5c25816e13ccdb27.yaml releasenotes/notes/add-initial-redfish-oem-extension-support-50c9849bb7b6b25c.yaml releasenotes/notes/add-mapped-list-field-04c671f7a73d83f6.yaml releasenotes/notes/add-network-adapter-26d01d8d9fb1d7ad.yaml @@ -87,6 +88,7 @@ releasenotes/notes/fix-insert-media-payload-b5d4c707f81d9603.yaml releasenotes/notes/fix-malformed-boot-mode-1ba1117cad8dcc47.yaml releasenotes/notes/fix-manager-action-d71fd415cea29aa6.yaml +releasenotes/notes/fix-missing-etags-ded8c0bb31fafef7.yaml releasenotes/notes/fix-oem-loading-52da045252b6c33e.yaml releasenotes/notes/fix-refine-resource-refresh-86c21ce230967251.yaml releasenotes/notes/fix-required-oem-attribute-parsing-205e4186275aa293.yaml @@ -144,6 +146,7 @@ releasenotes/notes/vmedia-credentials-14b7705c3c94cc07.yaml releasenotes/notes/workaround-sushy-requests-verify-handling-6879c273b651246f.yaml releasenotes/source/2023.1.rst +releasenotes/source/2023.2.rst releasenotes/source/conf.py releasenotes/source/index.rst releasenotes/source/pike.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushy-4.5.1/sushy.egg-info/pbr.json new/sushy-4.7.0/sushy.egg-info/pbr.json --- old/sushy-4.5.1/sushy.egg-info/pbr.json 2023-08-24 10:59:33.000000000 +0200 +++ new/sushy-4.7.0/sushy.egg-info/pbr.json 2023-11-23 10:43:02.000000000 +0100 @@ -1 +1 @@ -{"git_version": "7c2a251", "is_release": true} \ No newline at end of file +{"git_version": "b611b93", "is_release": true} \ No newline at end of file