summaryrefslogtreecommitdiffstats
path: root/cobbler/item_system.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-04-20 17:57:02 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-04-20 17:57:02 -0400
commitbb1e5b50e930b7c9618387cc43634e6050eb3481 (patch)
treeac7feb459190458ed21a57ae1bf7d5dc5b664666 /cobbler/item_system.py
parent8205bf0691bb48080c3bc4d0fd7c444238187801 (diff)
downloadthird_party-cobbler-bb1e5b50e930b7c9618387cc43634e6050eb3481.tar.gz
third_party-cobbler-bb1e5b50e930b7c9618387cc43634e6050eb3481.tar.xz
third_party-cobbler-bb1e5b50e930b7c9618387cc43634e6050eb3481.zip
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.
Diffstat (limited to 'cobbler/item_system.py')
-rw-r--r--cobbler/item_system.py12
1 files changed, 9 insertions, 3 deletions
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