Files
computer-playbook/cli/deploy/dedicated/apps.py
T
kevinveenbirkenbach 103659a534 refactor(deploy): modularize dedicated deploy CLI and fix make cwd issue
- Split dedicated deploy logic into focused modules (apps, modes, paths, proc, runner)
- Ensure all make targets run from the repository root via explicit cwd handling
- Fix "make: No rule to make target" errors caused by incorrect working directory
- Slim down __main__ to a thin CLI entrypoint
- Rework unit tests into one file per module and expand coverage

https://chatgpt.com/share/69472632-9740-800f-962c-bcb4474963d6
2025-12-20 23:41:41 +01:00

30 lines
850 B
Python

from __future__ import annotations
import sys
from typing import List
def validate_application_ids(inventory: str, app_ids: List[str]) -> None:
"""Validate requested application IDs using ValidDeployId."""
if not app_ids:
return
from module_utils.valid_deploy_id import ValidDeployId
validator = ValidDeployId()
invalid = validator.validate(inventory, app_ids)
if not invalid:
return
print("\n[ERROR] Some application_ids are invalid for this inventory:\n")
for app_id, status in invalid.items():
reasons = []
if not status.get("allowed", True):
reasons.append("not allowed by configuration")
if not status.get("in_inventory", True):
reasons.append("not present in inventory")
print(f" - {app_id}: {', '.join(reasons)}")
sys.exit(1)