@operation
def packages(
    state, host, packages=None,
    present=True, latest=False, upgrade=False, clean=False
):

    commands = []

    if clean:
        commands.append('yum clean all')

    if upgrade:
        commands.append('yum update -y')

    commands.extend(ensure_packages(
        packages, host.fact.rpm_packages, present,
        install_command='yum install -y',
        uninstall_command='yum remove -y',
        upgrade_command='yum update -y',
        latest=latest
    ))

    return commands
Check the connect/disconnect synchronous calls.
dataset/ETHPy150Open Fizzadar/pyinfra/pyinfra/modules/yum.py/packages--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_adbapi.py/ADBAPITestBase.checkConnect