Commit 23deaba2 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed db_host not passed to JobConfig by CLI argparser.

Former-commit-id: 74c75927
Former-commit-id: 5c32dff8
parent f6147de2
......@@ -47,7 +47,7 @@ def run_from_sceneids(args):
warnings.warn('Currently the console argument parser expects the given scenes as already downloaded.') # TODO
# create a new processing job from scene IDs
dbJob = GMS_JOB(get_conn_database(args.database_hostname))
dbJob = GMS_JOB(get_conn_database(args.db_host))
dbJob.from_sceneIDlist(list_sceneIDs=args.sceneids,
virtual_sensor_id=args.virtual_sensor_id,
datasetid_spatial_ref=args.datasetid_spatial_ref,
......@@ -61,7 +61,7 @@ def run_from_entityids(args):
:param args:
:return:
"""
dbJob = GMS_JOB(get_conn_database(args.database_hostname))
dbJob = GMS_JOB(get_conn_database(args.db_host))
dbJob.from_entityIDlist(list_entityids=args.entityids,
virtual_sensor_id=args.virtual_sensor_id,
datasetid_spatial_ref=args.datasetid_spatial_ref,
......@@ -75,7 +75,7 @@ def run_from_filenames(args):
:param args:
:return:
"""
dbJob = GMS_JOB(get_conn_database(args.database_hostname))
dbJob = GMS_JOB(get_conn_database(args.db_host))
dbJob.from_filenames(list_filenames=args.filenames,
virtual_sensor_id=args.virtual_sensor_id,
datasetid_spatial_ref=args.datasetid_spatial_ref,
......@@ -147,7 +147,7 @@ def get_gms_argparser():
# '-exec_L1AP': dict(nargs=3, type=bool, help="L1A Processor configuration",
# metavar=tuple("[run processor, write output, delete output]".split(' ')), default=[1, 1, 1]),
gop_p('-DH', '--database_hostname', nargs='?', type=str,
gop_p('-DH', '--db_host', nargs='?', type=str,
default=options_default["global_opts"]["db_host"],
help='host name of the server that runs the postgreSQL database')
......
......@@ -52,7 +52,8 @@ def set_config(job_ID, json_config='', exec_mode='Python', parallelization_level
exec_L1BP=None, exec_L1CP=None, exec_L2AP=None, exec_L2BP=None, exec_L2CP=None, CPUs=None,
allow_subMultiprocessing=True, disable_exception_handler=True, log_level='INFO',
tiling_block_size_XY=(2048, 2048), is_test=False, profiling=False, benchmark_global=False,
path_procdata_scenes=None, path_procdata_MGRS=None, path_archive=None):
path_procdata_scenes=None, path_procdata_MGRS=None, path_archive=None, virtual_sensor_id=10,
datasetid_spatial_ref=249):
"""Set up a configuration for a new gms_preprocessing job!
:param job_ID: job ID of the job to be executed, e.g. 123456 (must be present in database)
......@@ -90,7 +91,10 @@ def set_config(job_ID, json_config='', exec_mode='Python', parallelization_level
:param path_procdata_MGRS:
output path to store processed MGRS tiles
:param path_archive: input path where downloaded data are stored
:param virtual_sensor_id: 1: Landsat-8, 10: Sentinel-2A 10m
:param datasetid_spatial_ref: 249 Sentinel-2A
"""
# FIXME virtual_sensor_id and datasetid_spatial_ref are not respected by JobConfig.
if not hasattr(builtins, 'GMS_JobConfig') or reset_status:
kwargs = dict([x for x in locals().items() if x[0] != "self" and not x[0].startswith('__')])
builtins.GMS_JobConfig = JobConfig(job_ID, **kwargs)
......
......@@ -36,7 +36,7 @@ class Test_run_jobid(unittest.TestCase):
def tearDown(self):
del os.environ['GMS_IS_TEST']
def test_no_kwargs(self):
def test_hostame(self):
exec_call(self.base_cmd)
......
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