fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] fabric std output to file


From: Kaushal Shriyan
Subject: Re: [Fab-user] fabric std output to file
Date: Mon, 18 Jul 2016 19:54:46 +0530



On Mon, Jul 18, 2016 at 7:43 PM, Brandon Whaley <address@hidden> wrote:
There are two approaches here.  The first is to open a file and write the result of the 'w' command from within checkconn, the other is to redirect from the shell.

$ fab checkconn > checkconn_result.log

OR

def checkconn():
    result = run('w')
    with open('checkconn_result.log', 'w') as f:
        f.write(result)


Thank you Brandon for the suggestion.

Regards,

Kaushal


reply via email to

[Prev in Thread] Current Thread [Next in Thread]