Island: Simplify JSON logic inFileAgentConfigurationRepository

This commit is contained in:
Shreya Malviya 2022-08-30 22:56:02 +05:30
parent eb207de919
commit 82d8f5bacd
1 changed files with 2 additions and 2 deletions

View File

@ -31,10 +31,10 @@ class FileAgentConfigurationRepository(IAgentConfigurationRepository):
raise RetrievalError(f"Error retrieving the agent configuration: {err}") raise RetrievalError(f"Error retrieving the agent configuration: {err}")
def store_configuration(self, agent_configuration: AgentConfiguration): def store_configuration(self, agent_configuration: AgentConfiguration):
configuration_json = agent_configuration.dict() configuration_json = agent_configuration.json()
self._file_repository.save_file( self._file_repository.save_file(
AGENT_CONFIGURATION_FILE_NAME, io.BytesIO(json.dumps(configuration_json).encode()) AGENT_CONFIGURATION_FILE_NAME, io.BytesIO(configuration_json.encode())
) )
def reset_to_default(self): def reset_to_default(self):