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
The documentation page for writing an operation does not match the behaviour. Specifically, documentation says you can use
yield from files.file(
path="/some/file",
...,
)
Running this gives
Exception: Operation called within another operation, this is not allowed! Use the `_inner` function to call the underlying operation.
So this must instead be
yield from files.file._inner(
path="/some/file",
...,
)
Expected behavior
Documentation needs correcting at the least.
However I think it would be quite good if something similar to the documentation worked. This would allow us to group operations together similar to ansible's blocks.
alwaysmpe
changed the title
[bug/featufre request] Documentation for writing operations doesn't match behaviour
[bug/feature request] Documentation for writing operations doesn't match behaviour
Mar 7, 2024
Will update the docs, thank you for catching this!
I do agree not having to use the inner attribute would be ideal - however it’s not typing friendly. I couldn’t figure out a sensible way to type check it without using the inner attr (would welcome ideas, as long as there’s not too much magic).
Describe the bug
The documentation page for writing an operation does not match the behaviour. Specifically, documentation says you can use
Running this gives
So this must instead be
Expected behavior
Documentation needs correcting at the least.
However I think it would be quite good if something similar to the documentation worked. This would allow us to group operations together similar to ansible's blocks.
consider the example code:
This could also be achieved by adding a
@block()
style decorator.Meta
pyinfra --support
.pip install <3.x branch from github>
The text was updated successfully, but these errors were encountered: