Open atrifex opened 4 years ago
We eventually resolved this empty folder problem using code like the following:
# Clean up empty folders all_folders = [{ "repo": {"$eq": "repo-local"}, "path": {"$match": "path/*"}, }] folders = artifactory.filter(terms=all_folders, depth=None, item_type="folder") empty_folders = [] for folder in folders: folder_path = folder.get('path') + '/' + folder.get('name') + '*' folder_terms = [{ "repo": {"$eq": "repo-local"}, "path": {"$match": folder_path}, }] sub_items = artifactory.filter(terms=folder_terms, depth=None, item_type="any") if len(sub_items) == 0: empty_folders.append(folder)
We eventually resolved this empty folder problem using code like the following: