#NEWLINE# def _sync_command_error_squashed( arguments , logger ) : #NEWLINE# #INDENT# '\n    Synchronously run a command-line tool with the given arguments.\n\n    :param arguments: A ``list`` of ``bytes``, command-line arguments to\n        execute.\n\n    :param eliot.Logger logger: The log writer to use to log errors running the\n        zfs command.\n    ' #NEWLINE# message = None #NEWLINE# log_arguments = b' ' . join ( arguments ) #NEWLINE# try : #NEWLINE# #INDENT# process = Popen ( arguments , stdout = PIPE , stderr = STDOUT ) #NEWLINE# output = process . stdout . read ( ) #NEWLINE# status = process . wait ( ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# message = ZFS_ERROR ( zfs_command = log_arguments , output = str ( e ) , status = 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if status : #NEWLINE# #INDENT# message = ZFS_ERROR ( zfs_command = log_arguments , output = output , status = status ) #NEWLINE# #UNINDENT# #UNINDENT# if ( message is not None ) : #NEWLINE# #INDENT# message . write ( logger )