Raise error if IOU image is not configured

Fix #757
This commit is contained in:
Julien Duponchelle 2016-11-02 10:20:43 +01:00
parent 7c1a079ee8
commit 308706e3d4
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -169,6 +169,8 @@ class IOUVM(BaseNode):
Checks if IOUYAP executable is available and if image is accessible. Checks if IOUYAP executable is available and if image is accessible.
""" """
if not self._path:
raise IOUError("IOU image is not configured")
if not os.path.isfile(self._path) or not os.path.exists(self._path): if not os.path.isfile(self._path) or not os.path.exists(self._path):
if os.path.islink(self._path): if os.path.islink(self._path):
raise IOUError("IOU image '{}' linked to '{}' is not accessible".format(self._path, os.path.realpath(self._path))) raise IOUError("IOU image '{}' linked to '{}' is not accessible".format(self._path, os.path.realpath(self._path)))