Rm stderr debug output, stderr is not captured.
This commit is contained in:
		
					parent
					
						
							
								7c55364cc2
							
						
					
				
			
			
				commit
				
					
						2eab9b9598
					
				
			
		
					 3 changed files with 14 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -220,7 +220,8 @@ class Local(object):
 | 
			
		|||
            if save_output:
 | 
			
		||||
                output, errout = exec_util.call_get_output(command, env=env)
 | 
			
		||||
                self.log.debug("Local stdout: {}".format(output))
 | 
			
		||||
                self.log.debug("Local stderr: {}".format(errout))
 | 
			
		||||
                # Currently, stderr is not captured.
 | 
			
		||||
                # self.log.debug("Local stderr: {}".format(errout))
 | 
			
		||||
                if return_output:
 | 
			
		||||
                    return output.decode()
 | 
			
		||||
            else:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -173,7 +173,8 @@ class Remote(object):
 | 
			
		|||
        try:
 | 
			
		||||
            output, errout = exec_util.call_get_output(command, env=os_environ)
 | 
			
		||||
            self.log.debug("Remote stdout: {}".format(output))
 | 
			
		||||
            self.log.debug("Remote stderr: {}".format(errout))
 | 
			
		||||
            # Currently, stderr is not captured.
 | 
			
		||||
            # self.log.debug("Remote stderr: {}".format(errout))
 | 
			
		||||
            if return_output:
 | 
			
		||||
                return output.decode()
 | 
			
		||||
        except subprocess.CalledProcessError as e:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,9 +26,6 @@ from tempfile import TemporaryFile
 | 
			
		|||
import cdist
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
STDERR_UNSUPPORTED = '<Not yet supported>'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# IMPORTANT:
 | 
			
		||||
# with the code below in python 3.5 when command is executed and error
 | 
			
		||||
# occurs then stderr is not captured.
 | 
			
		||||
| 
						 | 
				
			
			@ -126,16 +123,21 @@ def call_get_output(command, env=None):
 | 
			
		|||
 | 
			
		||||
    assert isinstance(command, (list, tuple)), (
 | 
			
		||||
            "list or tuple argument expected, got: {}".format(command))
 | 
			
		||||
    return (_call_get_stdout(command, env), STDERR_UNSUPPORTED)
 | 
			
		||||
    return (_call_get_stdout(command, env), None)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def handle_called_process_error(err, command):
 | 
			
		||||
    errout = STDERR_UNSUPPORTED
 | 
			
		||||
    # Currently, stderr is not captured.
 | 
			
		||||
    # errout = None
 | 
			
		||||
    # raise cdist.Error("Command failed: " + " ".join(command) +
 | 
			
		||||
    #                   (" with returncode: {}\n"
 | 
			
		||||
    #                    "stdout: {}\n"
 | 
			
		||||
    #                    "stderr: {}").format(
 | 
			
		||||
    #                       err.returncode, err.output, errout))
 | 
			
		||||
    raise cdist.Error("Command failed: " + " ".join(command) +
 | 
			
		||||
                      (" with returncode: {}\n"
 | 
			
		||||
                       "stdout: {}\n"
 | 
			
		||||
                       "stderr: {}").format(
 | 
			
		||||
                          err.returncode, err.output, errout))
 | 
			
		||||
                       "stdout: {}").format(
 | 
			
		||||
                          err.returncode, err.output))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def _call_get_stdout(command, env=None):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue