Skip to content
Snippets Groups Projects
Verified Commit 6ce83f8a authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

resolve some errors, and fix build-docs.sh

parent d5516885
Branches
Tags
1 merge request!36resolve some errors, and fix build-docs.sh
Pipeline #83546 passed
pip install -r requirements.txt
pip install -e .
export SETTINGS_FILENAME=./config.json.example
python docs/dump-openapi-spec.py
rm -r ./docs/build/*
......@@ -5,3 +9,5 @@ sphinx-apidoc lso lso/app.py -o docs/source -d 2 -f
vale --config=docs/vale/.vale.ini sync
vale --config=docs/vale/.vale.ini docs/source/*.rst lso/*.py
sphinx-build -b html docs/source docs/build
unset SETTINGS_FILENAME
......@@ -6,7 +6,7 @@ import uuid
import ansible_runner
import requests
from pydantic import BaseModel
from pydantic import BaseModel, HttpUrl
logger = logging.getLogger(__name__)
......@@ -84,14 +84,14 @@ def _run_playbook_proc(job_id: str, playbook_path: str, extra_vars: dict, invent
assert request_result.status_code == 204
def run_playbook(playbook_path: str, extra_vars: dict, inventory: str, callback: str) -> PlaybookLaunchResponse:
def run_playbook(playbook_path: str, extra_vars: dict, inventory: str, callback: HttpUrl) -> PlaybookLaunchResponse:
"""Run an Ansible playbook against a specified inventory.
:param str playbook_path: playbook to be executed.
:param dict extra_vars: Any extra vars needed for the playbook to run.
:param [str] inventory: The inventory that the playbook is executed
against.
:param str callback: Callback URL where the playbook should send a status
:param :class:`HttpUrl` callback: Callback URL where the playbook should send a status
update when execution is completed. This is used for
workflow-orchestrator to continue with the next step in a workflow.
:return: Result of playbook launch, this could either be successful or
......
......@@ -2,12 +2,13 @@
For now only includes a single endpoint that responds with the current version of the API and LSO.
"""
import pkg_resources
from importlib import metadata
from fastapi import APIRouter
from pydantic import BaseModel, constr
API_VERSION = "0.1"
VERSION_STRING = constr(regex=r"\d+\.\d+")
VERSION_STRING = constr(pattern=r"\d+\.\d+")
router = APIRouter()
......@@ -25,4 +26,4 @@ def version() -> Version:
:return: Version object with both API and `goat-lso` versions numbers.
"""
return Version(api=API_VERSION, module=pkg_resources.get_distribution("goat-lso").version)
return Version(api=API_VERSION, module=metadata.version("goat-lso"))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment