fabric.api.env.roles not updated when using @roles #938
Comments
Calling Now, my PR introduces a new env var called @fab.task
@fab.roles('prod')
def prod():
# ... snip ...
deploy()
# ... snip ...
@fab.task
def deploy():
print fab.env.effective_roles
# ... snip ... Actually, deploy doesn't necessarily have to be decorated as |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also the following SO answer: http://stackoverflow.com/a/17724207/160665
When using the
@roles
decorator,fabric.api.env.roles
does not reflect this choice. This could cause issues when running a nested task which usesenv.roles
. A practical example from my case (leaving out the non-essential stuff):As illustrative purpose, running this fabfile gives me:
But I expected:
The text was updated successfully, but these errors were encountered: