INNER CODE UNIT · Python

extract_install_command

timothystewart6/k3s-ansible · .github/scripts/test-cilium-envoy-toggle.py:39

def extract_install_command(path):
    """Return the command string for the 'Install Cilium' task.

    Walks both top-level tasks and tasks nested inside a `block`/`always`/
    `rescue` list, since the Cilium deploy steps are grouped under the
    'Prepare Cilium CLI on first master and deploy CNI' block.
    """
    with open(path, encoding="utf-8") as handle:
        doc = yaml.safe_load(handle)

    def find_command(tasks):
        for task in tasks:
            if not isinstance(task, dict):
                continue
            if task.get("name") == "Install Cilium":
                command = task.get("ansible.builtin.command")
                if command is None:
                    raise SystemExit(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…