On Fri, Jul 25, 2014 at 08:24:43AM +0200, Vratislav Podzimek wrote:
> + else:
> + f.close()
> + os.unlink(repo_path)
> + raise PayloadSetupError("repo %s has no baseurl, mirrorlist or
metalink", repo.id)
I'm not sure about that, but doesn't this path result in the file being
closed twice? Is it just silently ignored or does it cause an error?
It works fine, it doesn't care if the file has been previously closed
when you exit the context.
> +
> + if ks_repo.ignoregroups:
> + f.write("enablegroups=0\n")
This long block could be indented less if the condition is negated and
followed with return.
Good point, I'm moving it anyway.
> + except RepoError:
> + continue
> + repo_path = iutil.getSysroot() + "/etc/yum.repos.d/%s.repo" %
repo.id
The "/etc/yum.repos.d" path should be a constant defined at the top of
the module. Or maybe the whole template.
I think just the path, since that is the part you may want to change in
the future. Users of the path add to the end of it.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)