Skip to content

Commit

Permalink
DnfContext: error out if no profile was found
Browse files Browse the repository at this point in the history
  • Loading branch information
jlebon committed Apr 23, 2021
1 parent cd510ee commit aee98b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libdnf/dnf-context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3480,6 +3480,9 @@ dnf_context_module_install(DnfContext * context, const char ** module_specs, GEr
std::vector<libdnf::ModuleProfile> profiles;
if (resolved_spec.first->getProfile() != "") {
profiles = modpkg->getProfiles(resolved_spec.first->getProfile());
if (profiles.empty()) {
throw std::runtime_error("No profile found matching " + resolved_spec.first->getProfile());
}
} else {
profiles.push_back(modpkg->getDefaultProfile());
}
Expand Down

0 comments on commit aee98b8

Please sign in to comment.