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_repo.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_repo.py')
-rw-r--r-- | cobbler/item_repo.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cobbler/item_repo.py b/cobbler/item_repo.py index c9846b1..19b2e3f 100644 --- a/cobbler/item_repo.py +++ b/cobbler/item_repo.py @@ -35,7 +35,8 @@ class Repo(item.Item): self.local_filename = ("", '<<inherit>>')[is_subobject] self.rpm_list = ("", '<<inherit>>')[is_subobject] self.createrepo_flags = ("-c cache", '<<inherit>>')[is_subobject] - + self.depth = 2 # arbitrary, as not really apart of the graph + def from_datastruct(self,seed_data): self.parent = self.load_item(seed_data, 'parent') self.name = self.load_item(seed_data, 'name') @@ -44,6 +45,7 @@ class Repo(item.Item): self.local_filename = self.load_item(seed_data, 'local_filename') self.rpm_list = self.load_item(seed_data, 'rpm_list') self.createrepo_flags = self.load_item(seed_data, 'createrepo_flags', '-c cache') + self.depth = self.load_item(seed_data, 'depth', 2) return self def set_name(self,name): @@ -130,7 +132,8 @@ class Repo(item.Item): 'local_filename' : self.local_filename, 'rpm_list' : self.rpm_list, 'createrepo_flags' : self.createrepo_flags, - 'parent' : self.parent + 'parent' : self.parent, + 'depth' : self.depth } def printable(self): |