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

Facts - Hardware - Ipv4Addrs - TypeError: Ipv4Addrs.process_data() missing 1 required positional argument: 'data' #831

Closed jrdot closed 2 years ago

jrdot commented 2 years ago

Describe the bug

The data argument is empty in code. Please review also the Ipv6Addrs Fact

To Reproduce

inventory.py

nodes = ["192.168.15.100"]

deploy.py

from pyinfra import host
from pyinfra.facts.hardware import Ipv4Addrs, NetworkDevices

config.SUDO=True

ips = host.get_fact(Ipv4Addrs)                       

Run:

pyinfra inventory.py deploy.py --data=ssh_user=vagrant

Expected behavior

Dict with network interfaces and address

Meta

Thank you very much and congratulations for the work.

Fizzadar commented 2 years ago

Thanks for reporting this @joserafaelterra, will investigate and get this fixed ASAP!

Fizzadar commented 2 years ago

This has now been fixed in v2.3 via https://github.com/Fizzadar/pyinfra/commit/88270e75b693c6936a62ff94826b49250ee7903c, apologies for the delay on this one. Note to self: need to test short facts.