Skip to content
Snippets Groups Projects
Commit 08b21897 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-418: processed review comment. Postponing synchronization to the LTA...

TMSS-418: processed review comment. Postponing synchronization to the LTA until a ProjectQuotaArchiveLocation is added to the project
parent b8e037a7
No related branches found
No related tags found
1 merge request!355Resolve TMSS-418
......@@ -39,9 +39,7 @@ class TMSSEventMessageHandlerForLTASynchronization(TMSSEventMessageHandler):
self._lta_db = LTACatalogueDatabaseConnection(dbcredentials.DBCredentials().get(lta_creds_id))
def onProjectCreated(self, name: str):
with self._tmss_client, self._lta_db:
project = self._tmss_client.get_path_as_json_object('project/%s' % name)
self._lta_db.create_project(project_name=project['name'], description=project['description'])
logger.info("Project '%s' was created in TMSS. Postponing synchronization to the LTA until a ProjectQuotaArchiveLocation is added to it...", name)
def onProjectUpdated(self, name: str):
logger.warning("TODO: implement synchronization to the LTA when a Project is updated")
......@@ -57,6 +55,7 @@ class TMSSEventMessageHandlerForLTASynchronization(TMSSEventMessageHandler):
assert project_quota['resource_type_id'] == 'lta_storage'
self._lta_db.create_project(project_name=project['name'], description=project['description'])
self._lta_db.add_project_storage_resource(project_name=project['name'], nr_of_bytes=project_quota['value'], uri=project_quota_archive_location['full_archive_uri'])
def onProjectQuotaArchiveLocationUpdated(self, id: int):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment