xenapi: Improve cross-device linking error message.
Catch invalid-cross device linking exceptions raise from os.rename and provide a more intelligible error message. Change-Id: I22b6a145141431b6d4e4cb0176881f0cf0dd609f
This commit is contained in:
@@ -46,7 +46,13 @@ def _link(src, dst):
|
|||||||
|
|
||||||
def _rename(src, dst):
|
def _rename(src, dst):
|
||||||
LOG.info("Renaming file '%s' -> '%s'" % (src, dst))
|
LOG.info("Renaming file '%s' -> '%s'" % (src, dst))
|
||||||
os.rename(src, dst)
|
try:
|
||||||
|
os.rename(src, dst)
|
||||||
|
except OSError, e:
|
||||||
|
if e.errno == errno.EXDEV:
|
||||||
|
LOG.error("Invalid cross-device link. Perhaps %s and %s should "
|
||||||
|
"be symlinked on the same filesystem?" % (src, dst))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
def make_subprocess(cmdline, stdout=False, stderr=False, stdin=False,
|
def make_subprocess(cmdline, stdout=False, stderr=False, stdin=False,
|
||||||
|
|||||||
Reference in New Issue
Block a user