Kickstart on RHEL 7 does not have metalink attr

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2020-01-07 08:25:52 +01:00
parent fcf1442f71
commit 2c2462970d
1 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ def main(ns, persistdir, cachedir):
if ks_repo.name not in gather_opts.lookaside_repos:
continue
if not ks_repo.metalink:
if not getattr(ks_repo, "metalink", False):
dnf_obj.add_repo(
ks_repo.name, ks_repo.baseurl, enablegroups=False
)
@ -129,7 +129,7 @@ def main(ns, persistdir, cachedir):
for ks_repo in ksparser.handler.repo.repoList:
if ks_repo.name in gather_opts.lookaside_repos:
continue
if not ks_repo.metalink:
if not getattr(ks_repo, "metalink", False):
dnf_obj.add_repo(ks_repo.name, ks_repo.baseurl)
else:
dnf_obj.add_repo(ks_repo.name, ks_repo.baseurl,