fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] append() with multi-line strings


From: Jeff Forcier
Subject: Re: [Fab-user] append() with multi-line strings
Date: Thu, 26 Sep 2013 10:55:36 -0700

Hi Thomas,

Yes, you should try using the list version of the call, I think that
might work better. The function uses a grep regex behind the scenes
and either it's not supporting multiline, or not setting the flag for
it by default (iirc).

Keep in mind that all of these contrib functions are convenience only
- you can always forego them or write code based on their
implementation :)

Thanks,
Jeff

On Wed, Sep 25, 2013 at 12:30 AM, Thomas Güttler <address@hidden> wrote:
> I want to use append() with strings containing newlines.
>
> I tried this:
>
> append('.netrc', 'machine source.foo.lan\n    login foo_readonly\n
> password removed', partial=True)
>
> and I tried it without partial=True.
>
> The lines get added to the file, regardless of existence. They get added
> again and again.
>
> fab --version
> Fabric 1.7.0
> Paramiko 1.11.0
>
> Should I split the lines to a list before calling append()?
>
> Regards,
>    Thomas
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fab-user



-- 
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org



reply via email to

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