diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2007-08-15 16:31:31 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2007-08-15 16:31:31 -0400 |
commit | 5e1781852fb81a3263692eda3b4977c8fb761c1a (patch) | |
tree | b21cbb7fbfc4f0fcc2f5c37f1dc8da10cec85068 /cobbler/item_profile.py | |
parent | cda9754a7ab3172ca45d083d7ee9d3bc7aa2c88e (diff) | |
download | third_party-cobbler-5e1781852fb81a3263692eda3b4977c8fb761c1a.tar.gz third_party-cobbler-5e1781852fb81a3263692eda3b4977c8fb761c1a.tar.xz third_party-cobbler-5e1781852fb81a3263692eda3b4977c8fb761c1a.zip |
Ben Riggs patch to allow find to take arbitrary variables plus a reworking
of find (mpd) to add some error checking, list returns, and other semi-useful
stuff. Plus tests and an optomization to allow name=foo as the only parameter
to be just as fast as before.
Diffstat (limited to 'cobbler/item_profile.py')
-rw-r--r-- | cobbler/item_profile.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py index c7c9814..4062826 100644 --- a/cobbler/item_profile.py +++ b/cobbler/item_profile.py @@ -91,7 +91,7 @@ class Profile(item.Item): # check must be done in two places as set_parent could be called before/after # set_name... raise CX(_("self parentage is weird")) - found = self.config.profiles().find(parent_name) + found = self.config.profiles().find(name=parent_name) if found is None: raise CX(_("profile %s not found, inheritance not possible") % parent_name) self.parent = parent_name @@ -102,7 +102,7 @@ class Profile(item.Item): Sets the distro. This must be the name of an existing Distro object in the Distros collection. """ - d = self.config.distros().find(distro_name) + d = self.config.distros().find(name=distro_name) if d is not None: self.distro = distro_name self.depth = d.depth +1 # reset depth if previously a subprofile and now top-level @@ -125,7 +125,7 @@ class Profile(item.Item): except: pass for r in repolist: - if not self.config.repos().find(r): + if not self.config.repos().find(name=r): ok = False break if ok: @@ -203,9 +203,9 @@ class Profile(item.Item): Return object next highest up the tree. """ if self.parent is None or self.parent == '': - result = self.config.distros().find(self.distro) + result = self.config.distros().find(name=self.distro) else: - result = self.config.profiles().find(self.parent) + result = self.config.profiles().find(name=self.parent) return result def is_valid(self): |