mirror of
				https://github.com/ansible-collections/community.general.git
				synced 2025-10-25 05:23:58 -07:00 
			
		
		
		
	Add integration tests for fetch/slurp, make powershell fetch/slurp work as close as possible to existing fetch/slurp modules.
This commit is contained in:
		
					parent
					
						
							
								ef968efa8b
							
						
					
				
			
			
				commit
				
					
						243cd877ae
					
				
			
		
					 13 changed files with 403 additions and 44 deletions
				
			
		|  | @ -57,19 +57,24 @@ class ActionModule(object): | |||
|             return ReturnData(conn=conn, result=results) | ||||
| 
 | ||||
|         source = os.path.expanduser(source) | ||||
|         source = conn.shell.join_path(source) | ||||
|         if os.path.sep not in conn.shell.join_path('a', ''): | ||||
|             source_local = source.replace('\\', '/') | ||||
|         else: | ||||
|             source_local = source | ||||
| 
 | ||||
|         if flat: | ||||
|             if dest.endswith("/"): # CCTODO: Fix path for Windows hosts. | ||||
|             if dest.endswith("/"): | ||||
|                 # if the path ends with "/", we'll use the source filename as the | ||||
|                 # destination filename | ||||
|                 base = os.path.basename(source) | ||||
|                 base = os.path.basename(source_local) | ||||
|                 dest = os.path.join(dest, base) | ||||
|             if not dest.startswith("/"): | ||||
|                 # if dest does not start with "/", we'll assume a relative path | ||||
|                 dest = utils.path_dwim(self.runner.basedir, dest) | ||||
|         else: | ||||
|             # files are saved in dest dir, with a subdir for each host, then the filename | ||||
|             dest = "%s/%s/%s" % (utils.path_dwim(self.runner.basedir, dest), conn.host, source) | ||||
|             dest = "%s/%s/%s" % (utils.path_dwim(self.runner.basedir, dest), conn.host, source_local) | ||||
| 
 | ||||
|         dest = os.path.expanduser(dest.replace("//","/")) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue