Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove copy fallback when hardlink failed #10952

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 8 additions & 20 deletions medusa/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,26 +353,14 @@ def hardlink_file(src_file, dest_file):
link(src_file, dest_file)
fix_set_group_id(dest_file)
except OSError as msg:
if msg.errno == errno.EEXIST:
# File exists. Don't fallback to copy
log.warning(
u'Failed to create hardlink of {source} at {destination}.'
u' Error: {error!r}', {
'source': src_file,
'destination': dest_file,
'error': msg
}
)
else:
log.warning(
u'Failed to create hardlink of {source} at {destination}.'
u' Error: {error!r}. Copying instead', {
'source': src_file,
'destination': dest_file,
'error': msg,
}
)
copy_file(src_file, dest_file)
log.warning(
u'Failed to create hardlink of {source} at {destination}.'
u' Error: {error!r}.', {
'source': src_file,
'destination': dest_file,
'error': msg,
}
)


def symlink(src, dst):
Expand Down