add doc/dev document that resulted in the troubleshooting document

Signed-off-by: Nico Schottelius <>
This commit is contained in:
Nico Schottelius 2013-08-28 15:32:01 +02:00
parent f50374af51
commit bc4a9fda3a
1 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,56 @@
running something in a manifest and that fails does not exist
the cdist run
Find out what the shell does:
[23:56] bento:testshell% cat
# source something that fails
[23:57] bento:testshell% cat
[23:57] bento:testshell% sh -e 2: .: not found
[23:57] bento:testshell% echo $?
-> exit 2 -> looks good
Find out what the python does:
[23:57] bento:testshell% python3
Python 3.3.2 (default, May 21 2013, 15:40:45)
[GCC 4.8.0 20130502 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.check_call(["/bin/sh", "-e", ""]) 2: .: not found
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.3/", line 544, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/bin/sh', '-e', '']' returned non-zero exit status 2
Manifests that execute (!) other shell scripts does
not necessarily give the -e flag to the other script
-> called script can have failures, but exit 0
if something the last thing executed does exit 0!
Instead of doing stuff like
sh -e "$__manifest/special"
or source the script:
. "$__manifest/special"
(runs the script in the same namespace/process as everything in the
calling script)