mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* Redfish: Do not set the boot source override mode if not provided by the user
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
* Corrected changelog file extension
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
* Update changelogs/fragments/3509-redfish_utils-SetOneTimeBoot-mode-fix.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 481fc48e51
)
Co-authored-by: Mike Raineri <michael.raineri@dell.com>
This commit is contained in:
parent
786ea68016
commit
ad4efaeb31
2 changed files with 6 additions and 5 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- redfish_utils module utils - do not attempt to change the boot source override mode if not specified by the user (https://github.com/ansible-collections/community.general/issues/3509/).
|
|
@ -1605,9 +1605,6 @@ class RedfishUtils(object):
|
|||
cur_boot_next = boot.get('BootNext')
|
||||
cur_override_mode = boot.get('BootSourceOverrideMode')
|
||||
|
||||
if not boot_override_mode:
|
||||
boot_override_mode = cur_override_mode
|
||||
|
||||
if override_enabled == 'Disabled':
|
||||
payload = {
|
||||
'Boot': {
|
||||
|
@ -1643,16 +1640,18 @@ class RedfishUtils(object):
|
|||
}
|
||||
}
|
||||
else:
|
||||
if cur_enabled == override_enabled and target == bootdevice and cur_override_mode == boot_override_mode:
|
||||
if (cur_enabled == override_enabled and target == bootdevice and
|
||||
(cur_override_mode == boot_override_mode or not boot_override_mode)):
|
||||
# If properties are already set, no changes needed
|
||||
return {'ret': True, 'changed': False}
|
||||
payload = {
|
||||
'Boot': {
|
||||
'BootSourceOverrideEnabled': override_enabled,
|
||||
'BootSourceOverrideMode': boot_override_mode,
|
||||
'BootSourceOverrideTarget': bootdevice
|
||||
}
|
||||
}
|
||||
if boot_override_mode:
|
||||
payload['Boot']['BootSourceOverrideMode'] = boot_override_mode
|
||||
|
||||
response = self.patch_request(self.root_uri + self.systems_uri, payload)
|
||||
if response['ret'] is False:
|
||||
|
|
Loading…
Reference in a new issue