Display better error message when linking fails
When failing to symbolically linking files, display the names of the files that could not be linked. This makes it easier to troubleshoot the error without having to manually figure out which files failed to link.
This commit is contained in:
parent
a97096ef96
commit
5394184d14
1 changed files with 7 additions and 3 deletions
|
@ -60,8 +60,12 @@ class Linker(Executor):
|
||||||
self._log.warning('Invalid link %s -> %s' %
|
self._log.warning('Invalid link %s -> %s' %
|
||||||
(link_name, self._link_destination(link_name)))
|
(link_name, self._link_destination(link_name)))
|
||||||
elif not self._exists(link_name) and self._exists(source):
|
elif not self._exists(link_name) and self._exists(source):
|
||||||
self._log.lowinfo('Creating link %s -> %s' % (link_name, source))
|
try:
|
||||||
os.symlink(source, os.path.expanduser(link_name))
|
os.symlink(source, os.path.expanduser(link_name))
|
||||||
|
except OSError as e:
|
||||||
|
self._log.warning('Linking failed %s -> %s' % (link_name, source))
|
||||||
|
else:
|
||||||
|
self._log.lowinfo('Creating link %s -> %s' % (link_name, source))
|
||||||
success = True
|
success = True
|
||||||
elif self._exists(link_name) and not self._is_link(link_name):
|
elif self._exists(link_name) and not self._is_link(link_name):
|
||||||
self._log.warning(
|
self._log.warning(
|
||||||
|
|
Loading…
Reference in a new issue