def run_command(self, cmd, 
                      sudo=False,
                      capture=True,
                      quiet=None,
                      return_result=False):

    '''run_command is a wrapper for the global run_command, checking first
       for sudo and exiting on error if needed. The message is returned as
       a list of lines for the calling function to parse, and stdout uses
       the parent process so it appears for the user.

       Parameters
       ==========
       cmd: the command to run
       sudo: does the command require sudo?
       quiet: if quiet set by function, overrides client setting.
       return_result: return the result, if not successful (default False).
       On success, returns result.

    '''
    # First preference to function, then to client setting
    if quiet == None:
        quiet = self.quiet

    result = run_cmd(cmd, sudo=sudo, capture=capture, quiet=quiet)

    # If one line is returned, squash dimension
    if len(result['message']) == 1:
        result['message'] = result['message'][0]

    # If the user wants to return the result, just return it
    if return_result is True:
        return result

    # On success, return result
    if result['return_code'] == 0:
        return result['message']

    return result
def run_command ( self , cmd , sudo = False , capture = True , quiet = None , return_result = False ) : if quiet == None : quiet = self . quiet result = run_cmd ( cmd , sudo = sudo , capture = capture , quiet = quiet ) if len ( result [ 'message' ] ) == 1 : result [ 'message' ] = result [ 'message' ] [ 0 ] if return_result is True : return result if result [ 'return_code' ] == 0 : return result [ 'message' ] return result
run_command is a wrapper for the global run_command, checking first
       for sudo and exiting on error if needed. The message is returned as
       a list of lines for the calling function to parse, and stdout uses
       the parent process so it appears for the user.

       Parameters
       ==========
       cmd: the command to run
       sudo: does the command require sudo?
       quiet: if quiet set by function, overrides client setting.
       return_result: return the result, if not successful (default False).
       On success, returns result.