简体   繁体   中英

Fabric surpresses stdout being written to screen

The next command in Fabric will not print the output to stdout. I have to manually type print output to print the output after execution (can take 10 minutes) Any ideas?

 with settings(warn_only=False), shell_env(ALLOWED_CHANGES="10"):
     if logfilename is  None:
         logfilename = "/tmp/deploy/deleteme"
     output = local("ALLOWED_CHANGES=1 bin/stack {dry} -d {env} -t {stack} --{op} 2>&1 | tee -a {log}".format(
         dry=dry,
         env=environ,
         stack=stack,
         log=logfilename,
         op=operation,
     ),
         capture=True
     )
     print "Output: "+output

This is expected . local will not print output if capture is True :

local is not currently capable of simultaneously printing and capturing output, as run / sudo do. The capture kwarg allows you to switch between printing and capturing as necessary, and defaults to False .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM