Converted to generator

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2020-01-30 17:16:08 +01:00
parent e49052f5b3
commit 3cc70413cd

View file

@ -29,11 +29,9 @@ def remove_repositories(repositories, default_repositories):
"""
Remove no default repositories
"""
repos = []
for repo in repositories:
if repo in default_repositories:
repos.append(repo)
return repos
yield repo
def update_repositories(repositories, conf_path):
@ -194,7 +192,7 @@ class MetaData:
mles_sub_repo = grab_sub_repo(repositories, "mles")
# remove no default repositories
repositories = remove_repositories(repositories, default_repositories)
repositories = list(remove_repositories(repositories, default_repositories))
# add custom repositories
update_repositories(repositories, conf_path)