This should be true for both profiles and systems.
eg:
profile 'testProfile' has three repos:
repo1
repo2
repo3
repo2 has yumopts 'enabled=0'
In the 'cobbler sync' generated kickstart for 'testProfile', $yum_repo_stanza should expand to:
repo --name=repo1 --baseurl=blah
repo --name=repo3 --baseurl=blahagain
A patch is attached in git diff format.
--Vito
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py index 139066e..c3fc132 100644 --- a/cobbler/action_sync.py +++ b/cobbler/action_sync.py @@ -30,6 +30,7 @@ import errno import item_distro import item_profile +import item_repo import item_system from Cheetah.Template import Template @@ -428,13 +429,16 @@ class BootSync: buf = "" blended = utils.blender(self.api, False, obj, self.blend_cache) - configs = self.get_repo_filenames(obj,is_profile) + repos = self.repos + for c in configs: name = c.split("/")[-1].replace(".repo","") (is_core, baseurl) = self.analyze_repo_config(c) - buf = buf + "repo --name=%s --baseurl=%s\n" % (name, baseurl) - + for repo in repos: + if repo.name == name: + if not repo.yumopts.has_key('enabled') or repo.yumopts['enabled'] == '1': + buf = buf + "repo --name=%s --baseurl=%s\n" % (name, baseurl) return buf def analyze_repo_config(self, filename):
_______________________________________________ et-mgmt-tools mailing list et-mgmt-tools@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/et-mgmt-tools