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

Use effective profile instead of an entirely new default profile when loading profiles #1193

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/Zonemaster/Backend/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ Loads and returns a set of named profiles.
my %profiles = %{ Zonemaster::Backend::Config->load_profiles( %all_profiles ) };

Takes a hash mapping profile names to profile paths.
An `undef` path value means the default profile.
An `undef` path value means the default (effective) profile.

Returns a hashref mapping profile names to profile objects.

The returned profiles have omitted values filled in with defaults from the
default profile.
The returned profiles have omitted values filled in with values from the
effective profile.

Dies if any of the given paths cannot be read or their contents cannot be parsed
as JSON.
Expand All @@ -93,7 +93,7 @@ sub load_profiles {
foreach my $name ( keys %profile_paths ) {
my $path = $profile_paths{$name};

my $full_profile = Zonemaster::Engine::Profile->default;
my $full_profile = Zonemaster::Engine::Profile->effective;
if ( defined $path ) {
my $json = eval { read_file( $path, err_mode => 'croak' ) } #
// die "Error loading profile '$name': $@";
Expand Down
Loading