def capture_journal(reactor, host, output_file):
 def get_journald_output():
  formatter = journald_json_formatter(output_file)
  ran = run_ssh(reactor=reactor, host=host, username='root', command=['journalctl', '--lines', '0', '--output', 'export', '--follow', '-u', 'docker', '-u', 'flocker-control', '-u', 'flocker-dataset-agent', '-u', 'flocker-container-agent', '-u', 'flocker-docker-plugin'], handle_stdout=formatter)
  ran.addErrback(write_failure, logger=None)
  ran.addCallback((lambda ignored: formatter('')))
  return ran
 return loop_until(reactor, get_journald_output, repeat(2.0))

def capture_journal ( reactor , host , output_file ) : def get_journald_output ( ) : formatter = journald_json_formatter ( output_file ) ran = run_ssh ( reactor = reactor , host = host , username = 'root' , command = [ 'journalctl' , '--lines' , '0' , '--output' , 'export' , '--follow' , '-u' , 'docker' , '-u' , 'flocker-control' , '-u' , 'flocker-dataset-agent' , '-u' , 'flocker-container-agent' , '-u' , 'flocker-docker-plugin' ] , handle_stdout = formatter ) ran . addErrback ( write_failure , logger = None ) ran . addCallback ( ( lambda ignored : formatter ( '' ) ) ) return ran return loop_until ( reactor , get_journald_output , repeat ( 2.0 ) )
ssh into given machine and capture relevant logs .