From 3883fe4247c4cbae5c6d9d4cfa8eef9a794f95db Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 16 Oct 2011 00:12:32 +0200 Subject: [PATCH] raise cdist error instead of oserror Signed-off-by: Nico Schottelius --- lib/cdist/exec/local.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cdist/exec/local.py b/lib/cdist/exec/local.py index 6157c0bc..264279a2 100644 --- a/lib/cdist/exec/local.py +++ b/lib/cdist/exec/local.py @@ -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__())