From bb1e5b50e930b7c9618387cc43634e6050eb3481 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 20 Apr 2007 17:57:02 -0400 Subject: This commit overhauls the main cobbler CLI module and adds support for object renaming, copying, and editing -- previously only addition and removal were supported. This frees uses (hopefully) from the need to hack YAML and risk damaging their configurations by rendering the config unparseable. It also makes "cobbler list" print out a simple tree representation that shows the association between objects. This also relaxes the requirements for what constitutes a kernel and initrd filename, just in case they are named something different. They still have to exist. --- cobbler/item_system.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cobbler/item_system.py') diff --git a/cobbler/item_system.py b/cobbler/item_system.py index 5f23be6..53cc979 100644 --- a/cobbler/item_system.py +++ b/cobbler/item_system.py @@ -18,9 +18,15 @@ import cexceptions class System(item.Item): - def __init__(self,config): - self.config = config - self.clear() + #def __init__(self,config): + # self.config = config + # self.clear() + + def make_clone(self): + ds = self.to_datastruct() + cloned = System(self.config) + cloned.from_datastruct(ds) + return cloned def clear(self): self.name = None -- cgit