Пустые строки в Fabric после вызова любой команды
import fabric from fabric.api import * env.hosts = ['d1','d2','d3','e1','e2','e3','e4'] env.parallel = True env.use_ssh_config = True fabric.state.output['running'] = False @task def uname(): run('uname -a')
Результат:
iMac:Fabric-1.6.0 vizh$ fab uname [e1] out: Linux e1 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e1] out: [e4] out: Linux e4 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e4] out: [e3] out: Linux e3 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e3] out: [e2] out: Linux e2 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e2] out: [d2] out: Linux d2 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux [d2] out: [d1] out: Linux d1 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux [d1] out: [d3] out: Linux d3 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux [d3] out: Done.
Вопрос: как избежать вывода пустых строк, что бы получилось так:
iMac:Fabric-1.6.0 vizh$ fab uname [e1] out: Linux e1 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e4] out: Linux e4 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e3] out: Linux e3 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e2] out: Linux e2 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [d2] out: Linux d2 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux [d1] out: Linux d1 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux [d3] out: Linux d3 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux Done.
Результат:
iMac:Fabric-1.6.0 vizh$ fab uname [e1] out: Linux e1 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e1] out: [e4] out: Linux e4 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e4] out: [e3] out: Linux e3 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e3] out: [e2] out: Linux e2 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e2] out: [d2] out: Linux d2 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux [d2] out: [d1] out: Linux d1 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux [d1] out: [d3] out: Linux d3 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux [d3] out: Done.
Вопрос: как избежать вывода пустых строк, что бы получилось так:
iMac:Fabric-1.6.0 vizh$ fab uname [e1] out: Linux e1 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e4] out: Linux e4 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e3] out: Linux e3 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [e2] out: Linux e2 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux [d2] out: Linux d2 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux [d1] out: Linux d1 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux [d3] out: Linux d3 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux Done.
Похожие публикации
Нет комментариев