fixup correct split/insert of os.environ() for target_host and args
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								26278b1e32
							
						
					
				
			
			
				commit
				
					
						8b561fd63c
					
				
			
		
					 2 changed files with 10 additions and 6 deletions
				
			
		| 
						 | 
					@ -33,7 +33,9 @@ def shell_run_or_debug_fail(script, *args, remote_prefix=False, **kargs):
 | 
				
			||||||
    args[0][:0] = [ "/bin/sh", "-e" ]
 | 
					    args[0][:0] = [ "/bin/sh", "-e" ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if remote_prefix:
 | 
					    if remote_prefix:
 | 
				
			||||||
        args[0][:0] = os.environ['__remote_exec']
 | 
					        remote_prefix = os.environ['__remote_exec'].split()
 | 
				
			||||||
 | 
					        remote_prefix.append(os.environ['target_host'])
 | 
				
			||||||
 | 
					        args[0][:0] = remote_prefix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    log.debug("Shell exec cmd: %s", args)
 | 
					    log.debug("Shell exec cmd: %s", args)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -62,7 +64,9 @@ def shell_run_or_debug_fail(script, *args, remote_prefix=False, **kargs):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def run_or_fail(*args, remote_prefix=False, **kargs):
 | 
					def run_or_fail(*args, remote_prefix=False, **kargs):
 | 
				
			||||||
    if remote_prefix:
 | 
					    if remote_prefix:
 | 
				
			||||||
        args[0][:0] = os.environ['__remote_exec']
 | 
					        remote_prefix = os.environ['__remote_exec'].split()
 | 
				
			||||||
 | 
					        remote_prefix.append(os.environ['target_host'])
 | 
				
			||||||
 | 
					        args[0][:0] = remote_prefix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    log.debug("Exec: " + " ".join(*args))
 | 
					    log.debug("Exec: " + " ".join(*args))
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -125,13 +125,13 @@ class Path:
 | 
				
			||||||
    def transfer_dir(self, source, destination):
 | 
					    def transfer_dir(self, source, destination):
 | 
				
			||||||
        """Transfer directory and previously delete the remote destination"""
 | 
					        """Transfer directory and previously delete the remote destination"""
 | 
				
			||||||
        self.remove_remote_dir(destination)
 | 
					        self.remove_remote_dir(destination)
 | 
				
			||||||
        cdist.exec.run_or_fail([os.environ['__remote_copy'], "-r", source,
 | 
					        cdist.exec.run_or_fail(os.environ['__remote_copy'].split() +
 | 
				
			||||||
                                self.target_host + ":" + destination])
 | 
					            ["-r", source, self.target_host + ":" + destination])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def transfer_file(self, source, destination):
 | 
					    def transfer_file(self, source, destination):
 | 
				
			||||||
        """Transfer file"""
 | 
					        """Transfer file"""
 | 
				
			||||||
        cdist.exec.run_or_fail([os.environ['__remote_copy'], source,
 | 
					        cdist.exec.run_or_fail(os.environ['__remote_copy'].split() +
 | 
				
			||||||
                                self.target_host + ":" + destination])
 | 
					            [source, self.target_host + ":" + destination])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def global_explorer_output_path(self, explorer):
 | 
					    def global_explorer_output_path(self, explorer):
 | 
				
			||||||
        """Returns path of the output for a global explorer"""
 | 
					        """Returns path of the output for a global explorer"""
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue