Skip to content

Commit

Permalink
Merge pull request #21 from ecmwf-projects/rename-validate-sc
Browse files Browse the repository at this point in the history
remove json, it is now a YAML
  • Loading branch information
garciampred authored Jul 9, 2024
2 parents 89489bf + 70b920e commit 3a24840
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions cdsobs/cli/_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
service_definition_json: str = typer.Argument(..., help="Path to JSON file")
def validate_service_definition(
service_definition: str = typer.Argument(..., help="Path to JSON file")
):
"""Validate a service definition JSON file."""
if not Path(service_definition_json).exists():
"""Validate a service definition YAML file."""
if not Path(service_definition).exists():
raise CliException("File not found")
validate_service_definition(service_definition_json)
cdsobs.service_definition.api.validate_service_definition(service_definition)
4 changes: 2 additions & 2 deletions cdsobs/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3a24840

Please sign in to comment.