forked from ungleich-public/cdist
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:
|
||||
remote_cat(script)
|
||||
else:
|
||||
script_fd = open(script)
|
||||
print(script_fd.read())
|
||||
script_fd.close()
|
||||
try:
|
||||
script_fd = open(script)
|
||||
print(script_fd.read())
|
||||
script_fd.close()
|
||||
except IOError as error:
|
||||
raise CdistError(str(error))
|
||||
|
||||
raise CdistError("Command failed (shell): " + " ".join(*args))
|
||||
except OSError as error:
|
||||
|
|
Loading…
Reference in a new issue