Skip to content

Commit

Permalink
fix: Dont remove jsonschema metadata files
Browse files Browse the repository at this point in the history
  • Loading branch information
mchavda-splunk committed Aug 13, 2021
1 parent 6cc76bd commit 539d8f6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions splunk_add_on_ucc_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,17 @@ def remove_files(path):
path (str): Path to remove *.egg-info and *.dist-info files.
"""

rmdirs = glob.glob(os.path.join(path, "*.egg-info")) + glob.glob(
os.path.join(path, "*.dist-info")
)
delete_list = ["*.egg-info", "*.dist-info"]
# the jsonschema is not working when metadata files are not present hence not removing jsonschema dist-info/egg-info directory
do_not_delete_list = ["jsonschema-*"]

rmdirs = set()
for item in delete_list:
rmdirs.update(set(glob.glob(os.path.join(path, item))))

for item in do_not_delete_list:
rmdirs.difference_update(set(glob.glob(os.path.join(path, item))))

for rmdir in rmdirs:
shutil.rmtree(rmdir)

Expand Down

0 comments on commit 539d8f6

Please sign in to comment.