diff --git a/lso/routes/playbook.py b/lso/routes/playbook.py index 00a41e2..437c3be 100644 --- a/lso/routes/playbook.py +++ b/lso/routes/playbook.py @@ -43,8 +43,8 @@ def _inventory_validator(inventory: dict[str, Any] | str) -> dict[str, Any] | st :raises HTTPException: If parsing fails or the format is incorrect. """ if not ansible_runner.utils.isinventory(inventory): - error_messages = "Invalid inventory provided. Should be a string, or JSON object." - raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=error_messages) + detail = "Invalid inventory provided. Should be a string, or JSON object." + raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=detail) loader = DataLoader() output = StringIO()