Fabric – Is there any way to capture run stdout?

Exactly what you are asking for should be happening. From the docs:

run will return the result of the remote program’s stdout as a single (likely multiline) string.

run(), and related commands like local() and sudo(), return an _AttributeString object that is just a wrapper around stdout with attribute access to additional information like failure/success booleans, stderr, the command run, etc. The result object also has a stdout attribute, which is just more explicit.

To troubleshoot, print type(output), output to be sure the response is what you expect. Examine output.failed and output.stderr. It could be the command isn’t doing what you expect, there is no “backups” directory, etc.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)