Added check of the exit code of puppet apply