raise cdist error instead of oserror

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-10-16 00:12:32 +02:00
parent 3c31b4f9a3
commit 3883fe4247
1 changed files with 4 additions and 2 deletions

View File

@ -136,5 +136,7 @@ class Local(object):
dst = os.path.join(self.bin_path, cdist_type.name)
self.log.debug("Linking emulator: %s to %s", src, dst)
# FIXME: handle exceptions
os.symlink(src, dst)
try:
os.symlink(src, dst)
except OSError as e:
raise cdist.Error("Linking emulator from " + src + " to " + dst + " failed: " + e.__str__())