mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00:00 
			
		
		
		
	utils/ssh.py: try to make failure to parse response more obvious
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							c4c76ebcf8
						
					
				
				
					commit
					5e13a045a3
				
			@@ -205,9 +205,13 @@ class SshConnection(object):
 | 
				
			|||||||
        try:
 | 
					        try:
 | 
				
			||||||
            with self.lock:
 | 
					            with self.lock:
 | 
				
			||||||
                _command = '({}); __devlib_ec=$?; echo; echo $__devlib_ec'.format(command)
 | 
					                _command = '({}); __devlib_ec=$?; echo; echo $__devlib_ec'.format(command)
 | 
				
			||||||
                raw_output = self._execute_and_wait_for_prompt(
 | 
					                full_output = self._execute_and_wait_for_prompt(_command, timeout, as_root, strip_colors)
 | 
				
			||||||
                    _command, timeout, as_root, strip_colors)
 | 
					                split_output = full_output.rsplit('\r\n', 2)
 | 
				
			||||||
                output, exit_code_text, _ = raw_output.rsplit('\r\n', 2)
 | 
					                try:
 | 
				
			||||||
 | 
					                    output, exit_code_text, _ = split_output
 | 
				
			||||||
 | 
					                except ValueError as e:
 | 
				
			||||||
 | 
					                    raise TargetStableError(
 | 
				
			||||||
 | 
					                        "cannot split reply (target misconfiguration?):\n'{}'".format(full_output))
 | 
				
			||||||
                if check_exit_code:
 | 
					                if check_exit_code:
 | 
				
			||||||
                    try:
 | 
					                    try:
 | 
				
			||||||
                        exit_code = int(exit_code_text)
 | 
					                        exit_code = int(exit_code_text)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user