def collect_command(host, command, dest_path):
 logging.info("Collecting '%s' ...", command)
 devnull = open('/dev/null', 'w')
 try:
  result = host.run(command, stdout_tee=devnull).stdout
  utils.open_write_close(dest_path, result)
 except Exception as e:
  logging.warning("Collection of '%s' failed:\n%s", command, e)
 finally:
  devnull.close()

def collect_command ( host , command , dest_path ) : logging . info ( "Collecting '%s' ..." , command ) devnull = open ( '/dev/null' , 'w' ) try : result = host . run ( command , stdout_tee = devnull ) . stdout utils . open_write_close ( dest_path , result ) except Exception as e : logging . warning ( "Collection of '%s' failed:\n%s" , command , e ) finally : devnull . close ( )
collects the result of a command on the remote machine .