abort() doubles the output message #1318
from fabric.api import abort, task @task() def test(): abort("Mxyzptlk")
This is the output of
This behavior was introduced by 96043d6. Not sure why though.
I propose either to roll it back or, if there is a good reason for that change, make it to something like this:
sys.exit(1 if output.aborts else msg)
PS: I've also reported this issue on fab-user mailing list back in March 13th
The text was updated successfully, but these errors were encountered:
I've been noticing this myself too, it is pretty annoying. Thanks for bringing it up again.
Dug up its source, which is #1213, wherein my feedback focused on whether it would change the exit code, and totally missed the printing angle. My mistake.
I think a different update than the one you suggest is required. The use case for #1213 seemed to be "I am catching SystemExit above Fabric-using code & want to see the abort message", and my guess is that's irrespective of whether one has aborts active (eg perhaps they're running it headless & want some metadata, such as "what happened with this particular job", stored separately from the raw stdout/stderr).
In other words, the conflation of additional metadata in the exception, with the print behavior, is our problem.
Dug into exactly how
So I think updating
I will implement this now. Should users identify problems with this approach, I am leaning towards reverting the original patch (or going for your meets-it-halfway suggestion), the benefits don't outweigh the ugly.