Skip to content

Apply os.remove() also to links, instead of shutil.rmtree#1251

Merged
boegel merged 2 commits intoeasybuilders:developfrom
damianam:intel_link
Sep 19, 2017
Merged

Apply os.remove() also to links, instead of shutil.rmtree#1251
boegel merged 2 commits intoeasybuilders:developfrom
damianam:intel_link

Conversation

@damianam
Copy link
Copy Markdown
Member

I cancelled an installation and when trying again EB failed trying to pass a symlink to shutil.rmtree. This should fix it.

@damianam damianam added this to the 3.4.1 milestone Sep 18, 2017
path = os.path.join(self.home_subdir_local, tree)
if os.path.isfile(path):
if os.path.isfile(path) or os.path.islink(path):
os.remove(path)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use remove_file instead from filetools (we don't have a remove_dir yet, and if we do, we should also add a remove that wraps around both remove_file and remove_dir)

Copy link
Copy Markdown
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@boegel
Copy link
Copy Markdown
Member

boegel commented Sep 19, 2017

Did a quick test with this in place, looks good, going in, thanks @damianam!

@boegel boegel merged commit 67be1c8 into easybuilders:develop Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants