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_system.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_system.py')
-rw-r--r-- | cobbler/item_system.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cobbler/item_system.py b/cobbler/item_system.py index cb7d02f..3575d79 100644 --- a/cobbler/item_system.py +++ b/cobbler/item_system.py @@ -93,9 +93,9 @@ class System(item.Item): Return object next highest up the tree. """ if self.parent is None or self.parent == '': - return self.config.profiles().find(self.profile) + return self.config.profiles().find(name=self.profile) else: - return self.config.systems().find(self.parent) + return self.config.systems().find(name=self.parent) def set_name(self,name): """ @@ -180,10 +180,10 @@ class System(item.Item): def set_profile(self,profile_name): """ - Set the system to use a certain named profile. The profile - must have already been loaded into the Profiles collection. - """ - p = self.config.profiles().find(profile_name) + Set the system to use a certain named profile. The profile + must have already been loaded into the Profiles collection. + """ + p = self.config.profiles().find(name=profile_name) if p is not None: self.profile = profile_name self.depth = p.depth + 1 # subprofiles have varying depths. @@ -229,8 +229,8 @@ class System(item.Item): def is_valid(self): """ - A system is valid when it contains a valid name and a profile. - """ + A system is valid when it contains a valid name and a profile. + """ # NOTE: this validation code does not support inheritable distros at this time. # this is by design as inheritable systems don't make sense. if self.name is None: |