summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-06-12 16:51:55 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-06-12 16:51:55 -0400
commit97d4406be919c5ac53e9d2dc2a5dc6e323bc19c4 (patch)
treea37a5b61ab386af1a20fc98e8050a24fe56cc5d9
parentfcbbaf14ae639c45c59275300b59106a753339c7 (diff)
downloadthird_party-cobbler-97d4406be919c5ac53e9d2dc2a5dc6e323bc19c4.tar.gz
third_party-cobbler-97d4406be919c5ac53e9d2dc2a5dc6e323bc19c4.tar.xz
third_party-cobbler-97d4406be919c5ac53e9d2dc2a5dc6e323bc19c4.zip
release bump
-rw-r--r--CHANGELOG3
-rw-r--r--cobbler.spec4
-rw-r--r--cobbler/item.py18
-rw-r--r--cobbler/item_distro.py3
-rw-r--r--cobbler/item_profile.py2
-rw-r--r--setup.py2
6 files changed, 19 insertions, 13 deletions
diff --git a/CHANGELOG b/CHANGELOG
index bfc042b..a4d5f98 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -11,6 +11,9 @@ Cobbler CHANGELOG
- Manpage cleanup
- Patch to allow pre and post triggers
- Patch to allow --createrepo-flags and to cache on import, fix multiple calls to createrepo
+- Various modifications to allow for profile inheritance
+- All variables in object tree now available for use in templating, nicer blending algorithms
+- ~2x speedup in unit tests due to caching of parent relationships
* Thu Apr 26 2007 - 0.4.8
- Make import friendlier for older distros
diff --git a/cobbler.spec b/cobbler.spec
index 8835d83..667009a 100644
--- a/cobbler.spec
+++ b/cobbler.spec
@@ -1,7 +1,7 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Summary: Boot server configurator
Name: cobbler
-Version: 0.4.9
+Version: 0.5.0
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
License: GPL
@@ -134,7 +134,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%changelog
-* Thu May 24 2007 Michael DeHaan <mdehaan@redhat.com> - 0.4.9-1
+* Wed Jun 12 2007 Michael DeHaan <mdehaan@redhat.com> - 0.5.0-1
- Upstream changes (see CHANGELOG)
- Added dnsmasq.template
diff --git a/cobbler/item.py b/cobbler/item.py
index 52ab9b9..45b58ff 100644
--- a/cobbler/item.py
+++ b/cobbler/item.py
@@ -29,22 +29,24 @@ class Item(serializable.Serializable):
self.config = config
self.settings = self.config._settings
self.clear()
- self.children = {}
+ self.children = {} # caching for performance reasons, not serialized
+ self.conceptual_parent = None # " "
def clear(self):
raise exceptions.NotImplementedError
- def get_children(self):
+ def get_children(self,sorted=True):
"""
Get direct children of this object.
FIXME: testing
"""
keys = self.children.keys()
- keys.sort()
+ if sorted:
+ keys.sort()
results = []
for k in keys:
- results.append(self.children[k])
+ results.append(self.children[k])
return results
def get_descendants(self):
@@ -55,7 +57,7 @@ class Item(serializable.Serializable):
FIXME: testing
"""
results = []
- kids = self.get_children()
+ kids = self.get_children(sorted=False)
results.extend(kids)
for kid in kids:
grandkids = kid.get_descendants()
@@ -73,6 +75,10 @@ class Item(serializable.Serializable):
The parent may just be a superclass for something like a
subprofile. Get the first parent of a different type.
"""
+
+ if self.conceptual_parent is not None:
+ return self.conceptual_parent
+
# FIXME: this is a workaround to get the type of an instance var
# what's a more clean way to do this that's python 2.3 friendly?
# this returns something like: cobbler.item_system.System
@@ -81,7 +87,9 @@ class Item(serializable.Serializable):
while parent is not None:
ptype = str(parent).split(" ")[0][1:]
if mtype != ptype:
+ self.conceptual_parent = parent
return parent
+
return None
def set_name(self,name):
diff --git a/cobbler/item_distro.py b/cobbler/item_distro.py
index e804cb9..02f2eab 100644
--- a/cobbler/item_distro.py
+++ b/cobbler/item_distro.py
@@ -167,8 +167,5 @@ class Distro(item.Item):
buf = buf + _("architecture : %s\n") % self.arch
buf = buf + _("ks metadata : %s\n") % self.ks_meta
buf = buf + _("breed : %s\n") % self.breed
- # FIXME: temporary
- buf = buf + _("children : %s\n") % self.get_children()
- buf = buf + _("descendants : %s\n") % self.get_descendants()
return buf
diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py
index 09358b0..8be30e9 100644
--- a/cobbler/item_profile.py
+++ b/cobbler/item_profile.py
@@ -192,7 +192,5 @@ class Profile(item.Item):
buf = buf + _("virt file size : %s\n") % self.virt_file_size
buf = buf + _("virt ram : %s\n") % self.virt_ram
buf = buf + _("repos : %s\n") % self.repos
- # FIXME: testing only
- buf = buf + _("children: : %s\n") % self.get_children()
return buf
diff --git a/setup.py b/setup.py
index bee580d..31706bd 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ import sys
from distutils.core import setup, Extension
import string
-VERSION = "0.4.9"
+VERSION = "0.5.0"
SHORT_DESC = "Boot and update server configurator"
LONG_DESC = """
Cobbler is a command line tool for configuration of boot/provisioning, and update servers which is also accessible as a Python library. Cobbler supports PXE, provisioning virtualized images, and reinstalling machines that are already up and running (over SSH). The last two modes require a helper tool called 'koan' that integrates with cobbler. Cobbler's advanced features include importing distributions from rsync mirrors, kickstart templating, integrated yum mirroring (and linking repository setup with kickstarts), plus managing dhcpd.conf.