summaryrefslogtreecommitdiff
path: root/plugins/xenserver/xenapi
diff options
context:
space:
mode:
authorBrian Elliott <bdelliott@gmail.com>2013-06-19 19:31:26 +0000
committerBrian Elliott <bdelliott@gmail.com>2013-06-26 15:02:28 +0000
commit1fcebf22a6541d0179251d850a98f657ca4482be (patch)
treeb0d4b967386742e330681f4cdd087a4945d87091 /plugins/xenserver/xenapi
parent7696c3c11f0de855cbc53cc04ee7d2be07ae3b9c (diff)
downloadnova-1fcebf22a6541d0179251d850a98f657ca4482be.tar.gz
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
Diffstat (limited to 'plugins/xenserver/xenapi')
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py
index 95f01bba34..a15ace92af 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py
@@ -46,7 +46,13 @@ def _link(src, dst):
def _rename(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,