remove useless if env:
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								1dcc420a38
							
						
					
				
			
			
				commit
				
					
						53c61d42ad
					
				
			
		
					 1 changed files with 3 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -146,18 +146,17 @@ class Remote(object):
 | 
			
		|||
        os_environ = os.environ.copy()
 | 
			
		||||
        os_environ['__target_host'] = self.target_host
 | 
			
		||||
 | 
			
		||||
        self.log.debug("Remote run script: %s", command)
 | 
			
		||||
 | 
			
		||||
        # can't pass environment to remote side, so prepend command with
 | 
			
		||||
        # variable declarations
 | 
			
		||||
        if env:
 | 
			
		||||
            self.log.debug("Remote run script env: %s", env)
 | 
			
		||||
            command.extend(["%s=%s" % item for item in env.items()])
 | 
			
		||||
 | 
			
		||||
        command.extend(["/bin/sh", "-e"])
 | 
			
		||||
        command.append(script)
 | 
			
		||||
 | 
			
		||||
        self.log.debug("Remote run script: %s", command)
 | 
			
		||||
        if env:
 | 
			
		||||
            self.log.debug("Remote run script env: %s", env)
 | 
			
		||||
 | 
			
		||||
        try:
 | 
			
		||||
            if return_output:
 | 
			
		||||
                return subprocess.check_output(command, env=os_environ).decode()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue