From a93a7943e393a4882322e552cc94daf17a9ab803 Mon Sep 17 00:00:00 2001 From: garciam Date: Thu, 4 Jul 2024 17:18:02 +0200 Subject: [PATCH 1/3] remove json, it is now a YAML --- cdsobs/cli/_validate.py | 6 +++--- cdsobs/cli/app.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cdsobs/cli/_validate.py b/cdsobs/cli/_validate.py index cacf24a..3bc1bd3 100644 --- a/cdsobs/cli/_validate.py +++ b/cdsobs/cli/_validate.py @@ -2,14 +2,14 @@ import typer +import cdsobs.service_definition.api from cdsobs.cli._utils import CliException -from cdsobs.service_definition.api import validate_service_definition -def validate_service_definition_json( +def validate_service_definition( service_definition_json: str = typer.Argument(..., help="Path to JSON file") ): """Validate a service definition JSON file.""" if not Path(service_definition_json).exists(): raise CliException("File not found") - validate_service_definition(service_definition_json) + cdsobs.service_definition.api.validate_service_definition(service_definition_json) diff --git a/cdsobs/cli/app.py b/cdsobs/cli/app.py index e1ecfa2..4bb4e5e 100644 --- a/cdsobs/cli/app.py +++ b/cdsobs/cli/app.py @@ -15,14 +15,14 @@ from cdsobs.cli._object_storage import check_consistency from cdsobs.cli._retrieve import retrieve from cdsobs.cli._utils import exception_handler -from cdsobs.cli._validate import validate_service_definition_json +from cdsobs.cli._validate import validate_service_definition app = typer.Typer( help="Copernicus Climate & Atmoshpere Data Store Observation Manager" " Command Line Interface", ) -validate_service_definition_json = app.command()(validate_service_definition_json) +validate_service_definition = app.command()(validate_service_definition) make_production = app.command()(make_production) retrieve = app.command()(retrieve) list_catalogue = app.command()(list_catalogue) From 9463a6f78d20255c012a6686b39a025fd03378cd Mon Sep 17 00:00:00 2001 From: garciam Date: Thu, 4 Jul 2024 17:25:28 +0200 Subject: [PATCH 2/3] rename the argument too --- cdsobs/cli/_validate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cdsobs/cli/_validate.py b/cdsobs/cli/_validate.py index 3bc1bd3..143608f 100644 --- a/cdsobs/cli/_validate.py +++ b/cdsobs/cli/_validate.py @@ -7,9 +7,9 @@ def validate_service_definition( - service_definition_json: str = typer.Argument(..., help="Path to JSON file") + service_definition: str = typer.Argument(..., help="Path to JSON file") ): """Validate a service definition JSON file.""" - if not Path(service_definition_json).exists(): + if not Path(service_definition).exists(): raise CliException("File not found") - cdsobs.service_definition.api.validate_service_definition(service_definition_json) + cdsobs.service_definition.api.validate_service_definition(service_definition) From 70b920e0da7acb1b37c8024879554eaa24f30a93 Mon Sep 17 00:00:00 2001 From: garciam Date: Thu, 4 Jul 2024 17:27:29 +0200 Subject: [PATCH 3/3] rename the docstring too --- cdsobs/cli/_validate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdsobs/cli/_validate.py b/cdsobs/cli/_validate.py index 143608f..234e8c2 100644 --- a/cdsobs/cli/_validate.py +++ b/cdsobs/cli/_validate.py @@ -9,7 +9,7 @@ def validate_service_definition( service_definition: str = typer.Argument(..., help="Path to JSON file") ): - """Validate a service definition JSON file.""" + """Validate a service definition YAML file.""" if not Path(service_definition).exists(): raise CliException("File not found") cdsobs.service_definition.api.validate_service_definition(service_definition)