rpmmd: fix LoadRepositories in case no valid path is provided
The LoadRepositories function interates over a list of paths and expects to find a distro configuration in one of them. The case when no path with valid configuration is found was not handled. This patch introduces the check.
This commit is contained in:
parent
0a4ce9dc68
commit
1e2ef9ada1
1 changed files with 3 additions and 0 deletions
|
|
@ -136,6 +136,9 @@ func LoadRepositories(confPaths []string, distro string) (map[string][]RepoConfi
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return nil, &RepositoryError{"LoadRepositories failed: none of the provided paths contain distro configuration"}
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
var repos map[string][]RepoConfig
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue