summaryrefslogtreecommitdiffstats
path: root/cobbler/item_profile.py
diff options
context:
space:
mode:
authorroot <root@mdehaan.rdu.redhat.com>2007-08-27 15:43:58 -0400
committerroot <root@mdehaan.rdu.redhat.com>2007-08-27 15:43:58 -0400
commit29081a493bf6617ee4a8ebea3893760cc1e711e2 (patch)
tree653e618ed904bf410f362bd36a6d2bb2300e9772 /cobbler/item_profile.py
parent159c39eef9df2fe4c4797f70a2598edb8a72d15b (diff)
downloadthird_party-cobbler-29081a493bf6617ee4a8ebea3893760cc1e711e2.tar.gz
third_party-cobbler-29081a493bf6617ee4a8ebea3893760cc1e711e2.tar.xz
third_party-cobbler-29081a493bf6617ee4a8ebea3893760cc1e711e2.zip
Fix bug in repo evaluation with inherited subprofiles.
Diffstat (limited to 'cobbler/item_profile.py')
-rw-r--r--cobbler/item_profile.py28
1 files changed, 19 insertions, 9 deletions
diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py
index f27f3a7..d8a7152 100644
--- a/cobbler/item_profile.py
+++ b/cobbler/item_profile.py
@@ -113,28 +113,38 @@ class Profile(item.Item):
raise CX(_("distribution not found"))
def set_repos(self,repos):
+
+ # allow the magic inherit string to persist
if repos == "<<inherit>>":
self.repos = "<<inherit>>"
return
- if type(repos) != list:
+ # store as an array regardless of input type
+ if repos is None:
+ repolist = []
+ elif type(repos) != list:
# allow backwards compatibility support of string input
repolist = repos.split(None)
else:
repolist = repos
- ok = True
+
+
+ # make sure there are no empty strings
try:
repolist.remove('')
except:
pass
+
+ self.repos = []
+
+ # if any repos don't exist, fail the operation
+ ok = True
for r in repolist:
- if not self.config.repos().find(name=r):
- ok = False
- break
- if ok:
- self.repos = repolist
- else:
- raise CX(_("repository not found"))
+ if self.config.repos().find(name=r) is not None:
+ self.repos.append(r)
+ else:
+ print _("warning: repository not found: %s" % r)
+
return True
def set_kickstart(self,kickstart):