doit/cmd_strace.py
def execute(self, params, args):
        """remove existing output file if any and do sanity checking"""
        if os.path.exists(self.TRACE_OUT): # pragma: no cover
            os.unlink(self.TRACE_OUT)
        if len(args) != 1:
            msg = ('strace failed, must select *one* task to strace.'
                   '\nCheck `{} help strace`.'.format(self.bin_name))
            raise InvalidCommand(msg)
        result = Run.execute(self, params, args)
        if (not params['keep_trace']) and os.path.exists(self.TRACE_OUT):
            os.unlink(self.TRACE_OUT)
        return result
remove existing output file if any and do sanity checking
remove existing output file if any and do sanity checking
remove existing output file if any and do sanity checking
def execute(self, params, args):
        if os.path.exists(self.TRACE_OUT): 
            os.unlink(self.TRACE_OUT)
        if len(args) != 1:
            msg = ('strace failed, must select *one* task to strace.'
                   '\nCheck `{} help strace`.'.format(self.bin_name))
            raise InvalidCommand(msg)
        result = Run.execute(self, params, args)
        if (not params['keep_trace']) and os.path.exists(self.TRACE_OUT):
            os.unlink(self.TRACE_OUT)
        return result
def execute ( self , params , args ) : if os . path . exists ( self . TRACE_OUT ) : os . unlink ( self . TRACE_OUT ) if len ( args ) != 1 : msg = ( 'strace failed, must select *one* task to strace.' '\nCheck `{} help strace`.' . format ( self . bin_name ) ) raise InvalidCommand ( msg ) result = Run . execute ( self , params , args ) if ( not params [ 'keep_trace' ] ) and os . path . exists ( self . TRACE_OUT ) : os . unlink ( self . TRACE_OUT ) return result
remove existing output file if any and do sanity checking
remove existing output file if any and do sanity checking
"""remove existing output file if any and do sanity checking""" # pragma: no cover
self
params
args