Island: Simplify configuration updating logic in PBAFileUpload

This commit is contained in:
Shreya Malviya 2022-08-30 23:39:35 +05:30
parent 4f599c3118
commit 6234263746
1 changed files with 2 additions and 9 deletions

View File

@ -101,16 +101,9 @@ class PBAFileUpload(AbstractResource):
agent_configuration = self._agent_configuration_repository.get_configuration() agent_configuration = self._agent_configuration_repository.get_configuration()
if target_os == LINUX_PBA_TYPE: if target_os == LINUX_PBA_TYPE:
custom_pbas = agent_configuration.custom_pbas.copy( agent_configuration.custom_pbas.linux_filename = safe_filename
update={"linux_filename": safe_filename}
)
else: else:
custom_pbas = agent_configuration.custom_pbas.copy( agent_configuration.custom_pbas.windows_filename = safe_filename
update={"windows_filename": safe_filename}
)
updated_agent_configuration = agent_configuration.copy(update={"custom_pbas": custom_pbas})
self._agent_configuration_repository.store_configuration(updated_agent_configuration)
@jwt_required @jwt_required
def delete(self, target_os): def delete(self, target_os):