-
Notifications
You must be signed in to change notification settings - Fork 12
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
ProfileCache: prepare_profile_cache checks for valid object template #127
Conversation
$profile .= ".pan" if ($profile !~ m/\.pan$/ ); | ||
$profile = "$resourcesdir/$profile" if $resourcesdir && $profile !~ m/^\//; | ||
my $ok; | ||
open(my $TPL, '<', $profile) or croak("is_object_template failed to open $profile: $!"); |
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.
I'd suggest is_object_template() failed...
to make clearer in the message that a function failed to do something...
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.
hmm. i originially tought that open would be the exception and thus used croak
, but now that i think about, a type in the use Quattor qw()
might be a lot more common, so i'll add a additional check for the existence of the file with proper clean handling. if the open then still fails, croak
provides plenty of information
Thanks for this. I have one minor comment: I think it'd be good to have a doc somewhere (can be on the web site and thus be done outside this PR) documenting how Also I'd suggest to change the title to something reflecting more the contents of the PR where the |
@jouvin wrt more code than title, this is based on #125. i'll rebase. |
cd5279d
to
7e127e5
Compare
@jrha another one best included before new build-tools are released |
…before attempting compilation
7e127e5
to
f16ff8e
Compare
Depends on #125
Fixes #126