|
From: | Sandeep L |
Subject: | Re: [Fab-user] Append out to a file in fabfile.py def() |
Date: | Fri, 28 Jun 2013 10:16:18 +0530 |
Hi Tod and jens,
Thanks for the help, its working now. -Sandeep. Date: Thu, 27 Jun 2013 10:29:22 -0400 Subject: Re: [Fab-user] Append out to a file in fabfile.py def() From: address@hidden To: address@hidden; address@hidden Hi Sandeep, Based on the error message below, it appears that Jens called it. In your fabfile.py, you should add some imports and use a task decorator: from fabric.api import env, execute, put, require, run, sudo, task, cd
import fabric.contrib.files env.hosts=["localhost"]
@task def append(): fabric.contrib.files.append("/home/sandeep/fabric/tmp/append", "test")
Note also that fabric.contrib.files.append() only appends the text if it is not already present in the file. Regards, Todd On Thu, Jun 27, 2013 at 9:29 AM, Sandeep L <address@hidden> wrote:
Todd DeLuca
Scientific Programmer |
[Prev in Thread] | Current Thread | [Next in Thread] |