Issue #19411 has been updated by Dominic Cleal.
Hi Charlie,
Charlie Sharpsteen wrote:
> I could not reproduce this on Ubuntu 12.04 or CentOS 6 with Puppet 2.7.14 or
> 3.1.0 using the commands you provided. Could you tell me:
>
> - Which operating system you are using.
>
> - Which method was used to install Puppet 2.7.14.
Apologies, I gave you a bad example command which depended on #19409 being
merged, I forgot to change branches. I picked 2.7.14 as the target version as
it looked like the issue went all the way back to module tool being merged.
This command will print JSON on failure, the original one wasn't good as it hit
an error handling routine.
$ puppet module --render-as json install error/error --module_repository
"http://localhost"
Notice: Preparing to install into /home/dcleal/.puppet/modules ...
Notice: Downloading from http://localhost ...
{"module_name":"error-error","module_version":null,"install_dir":"/home/dcleal/.puppet/modules","error":{"oneline":
"Unable to connect to the server at http://localhost. Detail: Connection
refused - connect(2).","multiline":"Could not connect to
http://localhost\n There was a network communications problem\n The
error we caught said 'Connection refused - connect(2)'\n
Check your network connection and try again"},"result":"failure"}
[dcleal@iridium ~]$ echo $?
0
Then again without the --render-as.
It looks like we have a console rendering handler in
lib/puppet/face/module/install.rb that sets the exit code, but there's no
equivalent for JSON or YAML rendering.
----------------------------------------
Bug #19411: puppet module failures with JSON/YAML rendering have exit code 0
https://projects.puppetlabs.com/issues/19411#change-83733
Author: Dominic Cleal
Status: Needs More Information
Priority: Normal
Assignee: Dominic Cleal
Category: module tool
Target version:
Affected Puppet version: 2.7.14
Keywords:
Branch:
When using puppet module with default console rendering, the exit code changes
if there's a failure:
$ puppet module install error/error >/dev/null 2>&1; echo $?
1
However when running with JSON or YAML rendering, it isn't changed:
$ puppet module --render-as json install error/error >/dev/null 2>&1; echo
$?
0
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.