pyinfra
pyinfra copied to clipboard
New config.py behaviour confusing
With the latest PyInfra release 1.6.3 and this config.py (in accordance to docs):
SUDO=True
REQUIRE_PACKAGES = []
I'm getting this error:
--> Loading config...
file: /Users/mjm/Dropbox/Devel/ACHN/Swarmlet/infra/config.py
Defining config variables directly is deprecated, please use `config.SUDO = True`.
--> pyinfra error: No deploy file: deploys/01_get_server_data.py
error: Recipe `get_droplet_data` failed on line 12 with exit code 1
However changing my config.py to:
config.SUDO=True
config.REQUIRE_PACKAGES = []
doesn't work either:
NameError: name 'config' is not defined
Sorry, I was wrong to assume that the error was caused by the deprecation warning. But it was my own doing.
you might consider updating the docs to warn people about the upcoming change. TIA
This was documented in the README here: https://github.com/Fizzadar/pyinfra/blob/current/CHANGELOG.md#v15. I do need to expand the documentation pages for this though as config is largely ignored.