fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] hide() not working as expected


From: Naim Shahidan
Subject: Re: [Fab-user] hide() not working as expected
Date: Fri, 4 Apr 2014 23:13:10 +0800

Hi Ronan,

i want to remove only this lines in my output.

> Disconnecting from 192.168.1.11... done.  
> Disconnecting from localhost... done.


i tried to hide stdout but all the output lines are gone. Only by using --hide, i manage to hide 'Disconnecting from..' lines  like this:
--hide status,running.


But from the script, using context_manager.settings, i cant get it right. 


regards,
Naim S.

On Friday, April 4, 2014, Ronan Amicel <address@hidden> wrote:
Hi Naim,

It looks like you want to hide the output of the commands that you're running.

Try hiding the 'stdout' output level to get that behavior:

      with hide('status', 'running', 'stdout'):
          # ...

See http://docs.fabfile.org/en/1.8/usage/output_controls.html

Regards,

Ronan Amicel

On Fri, Apr 4, 2014 at 7:04 AM, Naim Shahidan <address@hidden> wrote:
> Hi guys,
>
> im building a SSH dispatcher python script using Fabric module. Im using
> fabric.contex_manager to hide running and status message.
>
>
> But went i try to run the script, status message keep showing even though i
> use hide().
>
> =========== code snippet ==================
>
> def letsdoit():
>       with settings(hide('status', 'running')):
>              for server_name in deco_name:
>                   mydeco(server_name, host[i])
>
>
>
>
>
> ============== OUTPUT ======================
>
> ##########LOCALHOST###########
> current date:
> [localhost] out: Fri Apr  4 12:57:41 MYT 2014
> [localhost] out:
> system information:
> [localhost] out: Linux shad0w 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64
> GNU/Linux
> [localhost] out:
> ##########MYSERVER###########
> current date:
> [192.168.1.11] out: Fri Apr  4 12:57:59 MYT 2014
> [192.168.1.11] out:
> system information:
> [192.168.1.11] out: Linux modsec-dev-patchstore 3.11.0-15-generic
> #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64
> GNU/Linux
> [192.168.1.11] out:
>
> Done.
> Disconnecting from 192.168.1.11... done.   # status still showing
> Disconnecting from localhost... done.
>
>
> can someone kindly tell me whats going on?
>
>
>
> regards,
> Naim S.
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fab-user
>

reply via email to

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