Fix missing dirs cleanup.
This commit is contained in:
		
					parent
					
						
							
								519eb60664
							
						
					
				
			
			
				commit
				
					
						1ae5b1732e
					
				
			
		
					 3 changed files with 5 additions and 1 deletions
				
			
		|  | @ -260,6 +260,10 @@ class Config(object): | ||||||
|         if len(failed_hosts) > 0: |         if len(failed_hosts) > 0: | ||||||
|             raise cdist.Error("Failed to configure the following hosts: " + |             raise cdist.Error("Failed to configure the following hosts: " + | ||||||
|                               " ".join(failed_hosts)) |                               " ".join(failed_hosts)) | ||||||
|  |         elif not args.out_path: | ||||||
|  |             # If tmp out path created then remove it, but only if no failed | ||||||
|  |             # hosts. | ||||||
|  |             shutil.rmtree(base_root_path) | ||||||
| 
 | 
 | ||||||
|     @classmethod |     @classmethod | ||||||
|     def _resolve_ssh_control_path(cls): |     def _resolve_ssh_control_path(cls): | ||||||
|  |  | ||||||
|  | @ -79,7 +79,6 @@ class Local(object): | ||||||
|         self._init_log() |         self._init_log() | ||||||
|         self._init_permissions() |         self._init_permissions() | ||||||
|         self.mkdir(self.base_path) |         self.mkdir(self.base_path) | ||||||
|         # FIXME: create dir that does not require moving later |  | ||||||
|         self._init_cache_dir(None) |         self._init_cache_dir(None) | ||||||
|         self._init_paths() |         self._init_paths() | ||||||
|         self._init_object_marker() |         self._init_object_marker() | ||||||
|  |  | ||||||
|  | @ -49,6 +49,7 @@ class RemoteTestCase(test.CdistTestCase): | ||||||
| 
 | 
 | ||||||
|     def tearDown(self): |     def tearDown(self): | ||||||
|         shutil.rmtree(self.temp_dir) |         shutil.rmtree(self.temp_dir) | ||||||
|  |         shutil.rmtree(self.base_path) | ||||||
| 
 | 
 | ||||||
|     # test api |     # test api | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue