v2.1
First 2.x point release! Major feature: nested operations (at last!).
Based on the changes to operations in 2.x nested operations make it possible to generate & execute operations on the fly at execution time, rather than using the low-level connector API. This unlocks all kinds of complex deploys that were previously impossible or complex to implement. Let's look at an example:
from pyinfra import logger
from pyinfra.operations import python, server
def callback():
    result = server.shell(commands=["echo output"])
    logger.info(f"Got result: {result.stdout}")
python.call(
    name="Execute callback function",
    function=callback,
)Other new stuff:
- Add host.reload_fact(...)- bypasses the fact cache to force reloading of fact data
- Add deb.DebArchfact
- Add ssh_paramiko_connect_kwargshost data used in the@sshconnector
Bugfixes:
- Fix: Remove state/host arguments from apt.dist_upgrade operation (@pabloxio)
- Fix files.puthashing local file that doesn't exist whenassume_exists=True
- Fix parsing of link targets in RHEL 6 systems
- Prefer zypperoveraptwhen both present inserver.packagesoperation
Internal changes:
- Fix license link (@Lab-Brat)
- Run blackandisortacross the codebase, now part of CI