Commit 410dc619 authored by MAISSIAT's avatar MAISSIAT
Browse files

Fix #67: rename the project to eo-dataflow-manager

parent 6d3e9ff4
import unittest
from dchecktools.common.basefileinfos import SqliteBaseFilesInfos
from dchecktools.dreport import Config
from eo_dataflow_manager.dchecktools.common.basefileinfos import SqliteBaseFilesInfos
from eo_dataflow_manager.dchecktools.dreport import Config
import os
from datetime import datetime
......
import unittest
from dchecktools.filters import StringFilters
from eo_dataflow_manager.dchecktools.filters import StringFilters
class testStringFilters(unittest.TestCase):
......
import unittest
from dchecktools.reports import Report_ListFiles
from eo_dataflow_manager.dchecktools.reports import Report_ListFiles
# TODO : Realiser ce test
......
import unittest
from dchecktools.common import spliturl
from eo_dataflow_manager.dchecktools.common import spliturl
class SplitUrlTest(unittest.TestCase):
......
import unittest
from dchecktools.common import spliturl
from eo_dataflow_manager.dchecktools.common import spliturl
class testSplitUrl(unittest.TestCase):
......
......@@ -5,7 +5,7 @@ import logging
from .api.messages import EnhancedFileWriter, IMessageWriter
from .targets.EMMElastic import EMMElastic
from downloader.scheduler.com.ext.PublishRabbitMQ import PublishRabbitMQ
from eo_dataflow_manager.scheduler.com.ext.PublishRabbitMQ import PublishRabbitMQ
class EMMWriter(IMessageWriter):
......@@ -24,7 +24,7 @@ class EMMWriter(IMessageWriter):
path = os.path.join(globalConfig["paths.workspace"], path)
self.__file_writer = EnhancedFileWriter(
filename='downloader',
filename='eo-dataflow-manager',
directory=path,
extension='.xml'
)
......
......@@ -541,7 +541,7 @@ class Message(BaseElement):
def toDict(self, identifier=None):
def convToString(obj):
from downloader.scheduler.com.sys.File import File
from eo_dataflow_manager.scheduler.com.sys.File import File
if isinstance(obj, dict):
for key in obj:
......
......@@ -11,15 +11,16 @@ from xml.etree.ElementTree import ParseError
from ifr_lib.ifr_logging import setup_logging
from optparse import OptionParser
from downloader.scheduler.com.ext.XMLReader import XMLReader
from downloader.scheduler.com.sys.File import File
from downloader.scheduler.sc.Scheduler import EXIT_BAD_ARGS
from downloader.scheduler.sc.Download import DownloaderException
from downloader.scheduler.sc.DownloaderDatabase import DownloaderDatabase
import downloader.scheduler.sc.ConfigurationFileUtil
from downloader.scheduler.sc import LogUtil
from dchecktools.common.basefileinfos import FILE_URL_SEPARATOR
from downloader.scheduler.sc.GlobalConfig import GlobalConfig
from eo_dataflow_manager.scheduler.com.ext.XMLReader import XMLReader
from eo_dataflow_manager.scheduler.com.sys.File import File
from eo_dataflow_manager.scheduler.sc.Scheduler import EXIT_BAD_ARGS
from eo_dataflow_manager.scheduler.sc.Download import DownloaderException
from eo_dataflow_manager.scheduler.sc.DownloaderDatabase import DownloaderDatabase
import eo_dataflow_manager.scheduler.sc.ConfigurationFileUtil
from eo_dataflow_manager.scheduler.sc import LogUtil
from eo_dataflow_manager.dchecktools.common.basefileinfos import FILE_URL_SEPARATOR
from eo_dataflow_manager.scheduler.sc.GlobalConfig import GlobalConfig
from eo_dataflow_manager.scheduler.sc.ConfigurationFileUtil import ConfigurationFileUtil
VERSION = "1.1"
......@@ -52,7 +53,7 @@ class ReLoader(object):
parser.add_option("-c", "--config",
action="store", type="string",
dest="config", metavar="FILE [REQUIRED]",
help="Path to the downloader YAML config file.")
help="Path to the eo-dataflow-manager YAML config file.")
parser.add_option("-d", "--download",
action="store", type="string",
......@@ -97,37 +98,46 @@ class ReLoader(object):
return options, args
def run(self, options):
if options.debug_mode:
self.log.setLevel(logging.DEBUG)
def read_configuration(self, xml_file):
xr = XMLReader(self.log.name)
xr = XMLReader(LOGGER_NAME)
self.log.debug(" --> read of the download configuration : %s", options.download)
self.log.debug(" --> read of the download configuration : %s", xml_file)
try:
xmltree = xr.open(options.download)
xmltree = xr.open(xml_file)
except ExpatError:
raise IOError("invalid download_config file %s " % options.download)
raise IOError("invalid download_config file %s " % xml_file)
except IOError as e:
self.log.warning("Download_config file doesn't exist %s ", options.download)
self.log.warning("Download_config file doesn't exist %s ", xml_file)
raise DownloaderException(e)
except ParseError:
self.log.warning("Download_config file parse error %s ", options.download)
raise IOError("invalid download_config file %s " % options.download)
self.log.warning("Download_config file parse error %s ", xml_file)
raise IOError("invalid download_config file %s " % xml_file)
except Exception as e:
self.log.warning("Read download_config file error %s (%s)", options.download, e)
raise IOError("invalid download_config file %s " % options.download)
self.log.warning("Read download_config file error %s (%s)", xml_file, e)
raise IOError("invalid download_config file %s " % xml_file)
configuration = downloader.scheduler.sc.ConfigurationFileUtil.ConfigurationFileUtil(self.log.name, xr, xmltree)
configuration = ConfigurationFileUtil(LOGGER_NAME, xr, xmltree)
configuration.Read()
# Setup file logging target
LogUtil.setupFileLogger(
self.log,
self.__globalConfig["logs.file_log"],
os.path.join(self.__globalConfig.getPath('process_log_archive'), LOGGER_DEFAULT_FILE_NAME + configuration.id + ".log")
)
return configuration
def run(self, options):
configuration = self.read_configuration(options.download)
if not self.log.handlers:
# Setup file logging target
LogUtil.setupFileLogger(
self.log,
self.__globalConfig["logs.file_log"],
os.path.join(self.__globalConfig.getPath('process_log_archive'),
LOGGER_DEFAULT_FILE_NAME + configuration.id + ".log")
)
if options.debug_mode:
self.log.setLevel(logging.DEBUG)
self.log.info('Using download config file : %s', options.download)
self.log.info('Input reload file name : %s', options.filepath)
......
......@@ -4,7 +4,7 @@
import re
import os
import logging
from downloader.scheduler.sc import Controller
from eo_dataflow_manager.scheduler.sc import Controller
class PatternFilter(object):
def __init__(self):
......
......@@ -96,9 +96,10 @@ class PublishRabbitMQ():
body=json.dumps(message, default=customSerialize))
published = True
except pika.exceptions.StreamLostError:
except (pika.exceptions.StreamLostError, pika.exceptions.ChannelWrongStateError):
if retry:
fail = True;
fail = True
raise
else:
connection = pika.BlockingConnection(pika.ConnectionParameters(**self.__connectionParams))
channel = connection.channel()
......
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