Commit 11f8a202 authored by MAISSIAT's avatar MAISSIAT
Browse files

Rewrite of saving downloaded files

parent b3bbe3a7
Pipeline #5928 failed with stages
in 0 seconds
......@@ -523,14 +523,20 @@ class ConfigurationDestination(object):
result = True
if self.__xr.haveSubNode(self.__node, 'location'):
self.__location = self.__xr.getSubNodeValue(
logging.ERROR, self.__node, 'location')
self.__location = [self.__xr.getNodeValue(_)
for _ in self.__xr.getAllSubNode(self.__node, 'location')]
else:
self._log.error(
"the node '%s' don't have the required node '%s'" %
(self.__node.tag, 'location'))
result = False
if self.__xr.haveSubNode(self.__node, 'optional_spool_location'):
self.__optionalSpool = [self.__xr.getNodeValue(_)
for _ in self.__xr.getAllSubNode(self.__node, 'optional_spool_location')]
else:
self.__optionalSpool = []
if self.__xr.haveSubNode(self.__node, 'organization'):
organizationNode = self.__xr.getSubNode(
logging.ERROR, self.__node, 'organization')
......@@ -550,10 +556,6 @@ class ConfigurationDestination(object):
if keepParentFolder and keepParentFolder.lower() == 'true':
self.__keepParentFolder = True
if self.__xr.haveSubNode(self.__node, 'optional_spool_location'):
self.__optionalSpool = self.__xr.getSubNodeValue(
logging.ERROR, self.__node, 'optional_spool_location')
if self.__xr.haveSubNode(self.__node, 'post-processing'):
postPrecessingNode = self.__xr.getSubNode(
logging.ERROR, self.__node, 'post-processing')
......@@ -591,9 +593,11 @@ class ConfigurationDestination(object):
self.__fileGroupName = self.__xr.getSubNodeValue(
logging.ERROR, postPrecessingNode, 'file_group_name')
if self.__xr.haveSubNode(postPrecessingNode, "spool_link"):
self.__spoolLink = self.__xr.getSubNodeValue(
logging.ERROR, postPrecessingNode, "spool_link")
if self.__xr.haveSubNode(postPrecessingNode, 'spool_link'):
self.__spoolLink = [self.__xr.getNodeValue(_)
for _ in self.__xr.getAllSubNode(postPrecessingNode, 'spool_link')]
else:
self.__spoolLink = []
return result
......
......@@ -441,7 +441,7 @@ class DownloaderDatabase(object):
q = self.session.query(DBDownload)
f = True
if folder is not None:
f = and_(f, DBDownload.filepath.like("%" + folder + "%"))
f = and_(f, DBDownload.filepath.like("%/" + folder + "/%"))
q = q.filter(f)
q = q.order_by(DBDownload.state.desc())
res = q.all()
......
......@@ -10,7 +10,7 @@ author-email = sherleda@ifremer.fr
license = GPLv3
# Python version
requires-python = >=3.7 <3.8
requires-python = >=3.8 <3.9
# Installation -------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment