-
-
Notifications
You must be signed in to change notification settings - Fork 430
Open
Labels
bugLabel for all kind of bugs.Label for all kind of bugs.
Description
Describe the bug
Running a simple example with exec crashes.
To Reproduce
$ pyinfra incus.fritz.box exec -- echo test
--> Loading config...
--> Loading inventory...
--> An internal exception occurred:
File "/home/marc/Documents/infra/.venv/lib/python3.13/site-packages/pyinfra/context.py", line 55, in __getattr__
return getattr(self._get_module(), key)
AttributeError: 'State' object has no attribute 'config'
This works pyinfra @ssh/incus.fritz.box exec -- echo test
I guess there is somehow a naming clash with host name and my deploy script (incus.py).
Meta
$ pyinfra --support
If you are having issues with pyinfra or wish to make feature requests, please
check out the GitHub issues at https://github.com/Fizzadar/pyinfra/issues .
When adding an issue, be sure to include the following:
System: Linux
Platform: Linux-6.12.41+deb13-amd64-x86_64-with-glibc2.41
Release: 6.12.41+deb13-amd64
Machine: x86_64
pyinfra: v3.4.1
click: v8.2.1
click: v8.2.1
click: v8.2.1
distro: v1.9.0
gevent: v25.5.1
jinja2: v3.1.6
packaging: v25.0
paramiko: v3.5.1
python-dateutil: v2.9.0.post0
pywinrm: v0.5.0
typeguard: v4.4.4
typing-extensions: v4.14.1
Executable: /home/marc/Documents/infra/.venv/bin/pyinfra
Python: 3.13.5 (CPython, GCC 14.2.0)
$ cat pyinfra-debug.log
File "/home/marc/Documents/infra/.venv/lib/python3.13/site-packages/pyinfra_cli/main.py", line 225, in cli
_main(*args, **kwargs)
~~~~~^^^^^^^^^^^^^^^^^
File "/home/marc/Documents/infra/.venv/lib/python3.13/site-packages/pyinfra_cli/main.py", line 329, in _main
inventory = make_inventory(
inventory,
...<2 lines>...
group_data_directories=group_data,
)
File "/home/marc/Documents/infra/.venv/lib/python3.13/site-packages/pyinfra_cli/inventory.py", line 164, in make_inventory
inventory_func = try_import_module_attribute(inventory, raise_for_none=False)
File "/home/marc/Documents/infra/.venv/lib/python3.13/site-packages/pyinfra_cli/util.py", line 176, in try_import_module_attribute
spec = find_spec(possible)
File "<frozen importlib.util>", line 91, in find_spec
File "/home/marc/Documents/infra/incus.py", line 13, in <module>
add_contrib = files.line(
name="Add contrib to sources.list",
...<2 lines>...
replace="deb http://deb.debian.org/debian/ trixie main contrib non-free-firmware",
)
File "/home/marc/Documents/infra/.venv/lib/python3.13/site-packages/pyinfra/api/operation.py", line 235, in decorated_func
global_arguments, global_argument_keys = pop_global_arguments(state, host, kwargs)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/marc/Documents/infra/.venv/lib/python3.13/site-packages/pyinfra/api/arguments.py", line 306, in pop_global_arguments
config = state.config
^^^^^^^^^^^^
File "/home/marc/Documents/infra/.venv/lib/python3.13/site-packages/pyinfra/context.py", line 55, in __getattr__
return getattr(self._get_module(), key)
AttributeError: 'State' object has no attribute 'config'
- How was pyinfra installed (source/pip)? uv
aasseman
Metadata
Metadata
Assignees
Labels
bugLabel for all kind of bugs.Label for all kind of bugs.