I have a python fabric file fabfile.py. I wish to store the result of a local command in a variable so that I can test it for various cases. For example I want to do this...
substring = "up-to-date"
msg = local("git pull")
if msg.find(substring) == -1:
"some action"
but I am not able to store the output in "msg variable". How can I do this ?
The way I've done this before is: