diff options
author | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-06-13 18:03:33 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-06-13 18:03:33 -0400 |
commit | 5eaa46b5af9e89c881645eab69abfa787a6f7e29 (patch) | |
tree | 643767edc11cc71b7f84180c63142610daa2938f /cobbler/item_distro.py | |
parent | 53fb6c70d0a869de623e4e4b02d78e2a2b6b9f63 (diff) | |
download | third_party-cobbler-5eaa46b5af9e89c881645eab69abfa787a6f7e29.tar.gz third_party-cobbler-5eaa46b5af9e89c881645eab69abfa787a6f7e29.tar.xz third_party-cobbler-5eaa46b5af9e89c881645eab69abfa787a6f7e29.zip |
Keep track of depth of cobbler objects such that a pseudo-topological sort
can be done at deserialization time. The result of this is that full graph
listing information can be reconstructed at time of config loading (up and
down links), while only having to store the up links.
This preserves the existing config file format while allowing for arbitrary inheritance and
a reasonable measure of hand-editability.
If changing profile relationships by hand, the cached depth info may be wrong,
so some way to automatically resolve this could potentially be doable,
but it's such a distinct corner case that I don't deem it neccessary at this point.
Diffstat (limited to 'cobbler/item_distro.py')
-rw-r--r-- | cobbler/item_distro.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cobbler/item_distro.py b/cobbler/item_distro.py index b6a5bea..8fa7682 100644 --- a/cobbler/item_distro.py +++ b/cobbler/item_distro.py @@ -38,6 +38,7 @@ class Distro(item.Item): self.arch = ('x86', '<<inherit>>')[is_subobject] self.breed = ('redhat', '<<inherit>>')[is_subobject] self.source_repos = ([], '<<inherit>>')[is_subobject] + self.depth = 0 def make_clone(self): ds = self.to_datastruct() @@ -69,6 +70,7 @@ class Distro(item.Item): self.arch = self.load_item(seed_data,'arch','x86') self.breed = self.load_item(seed_data,'breed','redhat') self.source_repos = self.load_item(seed_data,'source_repos',[]) + self.depth = self.load_item(seed_data,'depth',0) # backwards compatibility -- convert string entries to dicts for storage if type(self.kernel_options) != dict: @@ -161,7 +163,8 @@ class Distro(item.Item): 'arch' : self.arch, 'breed' : self.breed, 'source_repos' : self.source_repos, - 'parent' : self.parent + 'parent' : self.parent, + 'depth' : self.depth } def printable(self): |