You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use the packaged deployments from within Python code to build a more dynamic deployer system which would have a UI.
How would I go about running the packaged deployments this way? By just calling the packaged deploy I get a exception: type object 'State' has no attribute 'config'
However, it's not entirely clear from this how you'd invoke a packaged deploy. In the CLI code, it looks like the following function is responsible for loading a deploy script:
It's not entirely clear to me what the invoked _parallel_load_hosts function is doing, but if you look at it, it seems to be passing a pyinfra.api.state.State object to the current Context, and ultimately, compiling the packaged deploy and executing it with Python's builtin exec function (here).
(I have a somewhat similar problem, trying to execute a particular function programmatically – if I end up creating an issue for it, I'll link this one too, in case the answers might be of assistance to you too.)
I would like to use the packaged deployments from within Python code to build a more dynamic deployer system which would have a UI.
How would I go about running the packaged deployments this way? By just calling the packaged deploy I get a exception:
type object 'State' has no attribute 'config'
Is there a way to do this and could an example be provided? In the documentation currently only how to use the CLI is extensively described.
https://docs.pyinfra.com/en/2.x/deploy-process.html
The text was updated successfully, but these errors were encountered: