Skip to content
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

Add "set -e" to consumer script #191

Merged
merged 1 commit into from
Jan 25, 2018
Merged

Conversation

mdellweg
Copy link
Member

Not sure if you want this, but whenever this option is not set for a shell script, i loose days searching for the line where something failed.

order => '01',
}

concat::fragment { "${title}+default_ca_data":
target => $title,
content => "read -r -d '' KATELLO_DEFAULT_CA_DATA << EOM\n",
content => "read -r -d '' KATELLO_DEFAULT_CA_DATA << EOM || true\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which case does this fail?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, every time. Do not know why, though

root@steve-ratzloff:~# read -d '' -r TEST << EOF
> asdf
> EOF
root@steve-ratzloff:~# echo $TEST $?
asdf 1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right: from man read:

The exit status is zero, unless end-of-file is encountered

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for diving into this.
But now i remember, that is why while read LINE works.

@ekohl ekohl merged commit f188ea0 into theforeman:master Jan 25, 2018
@ekohl
Copy link
Member

ekohl commented Jan 25, 2018

Thanks!

@mdellweg mdellweg deleted the fail_early_in_bash branch October 9, 2018 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants