-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Habitat Profiles: redirect stderr to stdout #1826
Conversation
@@ -346,16 +352,15 @@ def run_hook_contents | |||
|
|||
while true; do | |||
echo "Executing InSpec for ${PROFILE_IDENT}" | |||
inspec exec {{pkg.path}}/dist --format=json > ${RESULTS_FILE} 2>${ERROR_FILE} | |||
inspec exec {{pkg.path}}/dist --format=json > ${RESULTS_FILE} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we're deleting this can you also remove https://github.com/chef/inspec/pull/1826/files#diff-93d8a0fc1b64e361ffb0725d8ed10a37L342
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
f908804
to
0940c64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I would prefer to have stdout and stderr in separate stream, I understand that we need this combined at this point
Due to habitat-sh/habitat#2395, we shouldn't try to log stderr output to a file for now. While this makes for a less-than-awesome UX, it's better than a process locking up due to a buffer filling up! This change redirects stderr from InSpec to stdout and adds some helpful troubleshooting messages. Should InSpec be able to generate unique exit codes for when controls fail (vs. a Ruby eval failure) then we can fix this up some more, too. Signed-off-by: Adam Leff <adam@leff.co>
0940c64
to
266f061
Compare
Due to habitat-sh/habitat#2395, we shouldn't try to log stderr output
to a file for now. While this makes for a less-than-awesome UX, it's
better than a process locking up due to a buffer filling up!
This change redirects stderr from InSpec to stdout and adds some
helpful troubleshooting messages. Should InSpec be able to generate
unique exit codes for when controls fail (vs. a Ruby eval failure)
then we can fix this up some more, too.