summaryrefslogtreecommitdiffstats
path: root/cobbler/item_system.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-07-12 19:03:04 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-07-12 19:03:04 -0400
commitc56cd98d32f92efa433fb42626093ab35205d094 (patch)
tree78db68188fa995c48c0f24a55d5ba161a90677b2 /cobbler/item_system.py
parentb0e5e9b837f95d9ed255d17024345e69bbff86c2 (diff)
downloadthird_party-cobbler-c56cd98d32f92efa433fb42626093ab35205d094.tar.gz
third_party-cobbler-c56cd98d32f92efa433fb42626093ab35205d094.tar.xz
third_party-cobbler-c56cd98d32f92efa433fb42626093ab35205d094.zip
Adding plumbing in cobbler for --virt-path and --virt-type options.
Diffstat (limited to 'cobbler/item_system.py')
-rw-r--r--cobbler/item_system.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/cobbler/item_system.py b/cobbler/item_system.py
index caa6ace..8c908c0 100644
--- a/cobbler/item_system.py
+++ b/cobbler/item_system.py
@@ -39,6 +39,8 @@ class System(item.Item):
self.hostname = ("", '<<inheirt>>')[is_subobject]
self.depth = 2
self.kickstart = "<<inherit>>" # use value in profile
+ self.virt_path = "<<inherit>>" # use value in profile
+ self.virt_type = "<<inherit>>" # use value in profile
def from_datastruct(self,seed_data):
@@ -49,7 +51,9 @@ class System(item.Item):
self.ks_meta = self.load_item(seed_data, 'ks_meta', {})
self.depth = self.load_item(seed_data, 'depth', 2)
self.kickstart = self.load_item(seed_data, 'kickstart', '<<inherit>>')
-
+ self.virt_path = self.load_item(seed_data, 'virt_path', '<<inherit>>')
+ self.virt_type = self.load_item(seed_data, 'virt_type', '<<inherit>>')
+
# backwards compat, load --ip-address from two possible sources.
# the old --pxe-address was a bit of a misnomer, new value is --ip-address
@@ -186,6 +190,22 @@ class System(item.Item):
return True
raise CX(_("invalid profile name"))
+ def set_virt_path(self,path):
+ """
+ Virtual storage location suggestion, can be overriden by koan.
+ """
+ self.virt_path = path
+ return True
+
+ def set_virt_type(self,vtype):
+ """
+ Virtualization preference, can be overridden by koan.
+ """
+ if vtype.lower() not in [ "qemu", "xenpv" ]:
+ raise CX(_("invalid virt type"))
+ self.virt_type = vtype
+ return True
+
def set_netboot_enabled(self,netboot_enabled):
"""
If true, allows per-system PXE files to be generated on sync (or add). If false,
@@ -251,7 +271,9 @@ class System(item.Item):
'mac_address' : self.mac_address,
'parent' : self.parent,
'depth' : self.depth,
- 'kickstart' : self.kickstart
+ 'kickstart' : self.kickstart,
+ 'virt_type' : self.virt_type,
+ 'virt_path' : self.virt_path
}
def printable(self):
@@ -266,5 +288,7 @@ class System(item.Item):
buf = buf + _("config id : %s\n") % utils.get_config_filename(self)
buf = buf + _("netboot enabled? : %s\n") % self.netboot_enabled
buf = buf + _("kickstart : %s\n") % self.kickstart
+ buf = buf + _("virt type : %s\n") % self.virt_type
+ buf = buf + _("virt path : %s\n") % self.virt_path
return buf