Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added params support to update and delete methods in server profile #702

Merged
merged 1 commit into from
Jun 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions library/oneview_server_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def __update_server_profile(self, profile_with_updates):
# the update, and in case of failure mentioning powering off the SH, a Power off on
# the SH is attempted, followed by the update operation again and a Power On.
try:
self.current_resource.update(profile_with_updates)
self.current_resource.update(profile_with_updates, **self.params)
except OneViewModuleException as exception:
error_msg = '; '.join(str(e) for e in exception.args)
power_on_msg = 'Some server profile attributes cannot be changed while the server hardware is powered on.'
Expand All @@ -434,7 +434,7 @@ def __update_server_profile(self, profile_with_updates):
self.__set_server_hardware_power_state(profile_with_updates['serverHardwareUri'], 'Off')

self.module.log("Retrying update operation after server power off")
self.current_resource.update(profile_with_updates)
self.current_resource.update(profile_with_updates, **self.params)

self.module.log("Powering on the server hardware after update")
self.__set_server_hardware_power_state(self.current_resource.data['serverHardwareUri'], 'On')
Expand Down Expand Up @@ -583,7 +583,7 @@ def __delete_profile(self):
self.__set_server_hardware_power_state(self.current_resource.data['serverHardwareUri'],
'Off')

self.current_resource.delete()
self.current_resource.delete(**self.params)
return True, self.MSG_DELETED

def __make_compliant(self):
Expand Down