pyinfra-dev / pyinfra

pyinfra turns Python code into shell commands and runs them on your servers. Execute ad-hoc commands and write declarative operations. Target SSH servers, local machine and Docker containers. Fast and scales from one server to thousands.
https://pyinfra.com
MIT License
3.85k stars 374 forks source link

choco facts: `Invalid argument --local-only` #1044

Closed ronan-lg closed 6 months ago

ronan-lg commented 9 months ago

Describe the bug

With Chocolatey 2.0.0 (May 31, 2023), there was a breaking change: Change behavior of choco list to be local only - see #158.

Issue in pyinfra/facts/choco.py - ChocoPackages:

    command = "choco list --local-only"

To Reproduce

Steps to reproduce the behavior, please include where possible:

Expected behavior

No more use --local-only option:

    command = "choco list"

With output:

--> Starting operation: Choco/Packages (packages=cloc)
    [pyinfra\api\operations] Starting operation {'Choco/Packages'} on x.x.x.x
    [pyinfra\connectors\ssh] Running command on x.x.x.x: (pty=None) choco install -y cloc
[x.x.x.x] >>> choco install -y cloc
    [pyinfra\connectors\ssh] Waiting for exit status...
    [pyinfra\connectors\ssh] Command exit status: 0
    [x.x.x.x] Success

Meta

Fizzadar commented 6 months ago

Fixed in https://github.com/pyinfra-dev/pyinfra/commit/b6bec3d0fd844025360a43098614eec2a396e496, released just now in v2.9.1.