handle ioerror if script does not exist
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
a2f3246758
commit
91022c3f7e
1 changed files with 6 additions and 3 deletions
|
@ -181,9 +181,12 @@ class Cdist:
|
||||||
if remote:
|
if remote:
|
||||||
remote_cat(script)
|
remote_cat(script)
|
||||||
else:
|
else:
|
||||||
script_fd = open(script)
|
try:
|
||||||
print(script_fd.read())
|
script_fd = open(script)
|
||||||
script_fd.close()
|
print(script_fd.read())
|
||||||
|
script_fd.close()
|
||||||
|
except IOError as error:
|
||||||
|
raise CdistError(str(error))
|
||||||
|
|
||||||
raise CdistError("Command failed (shell): " + " ".join(*args))
|
raise CdistError("Command failed (shell): " + " ".join(*args))
|
||||||
except OSError as error:
|
except OSError as error:
|
||||||
|
|
Loading…
Reference in a new issue