summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
authorDavid Lutterkort <dlutter@redhat.com>2006-10-23 14:04:52 -0700
committerJim Meyering <jim@meyering.net>2006-10-23 14:04:52 -0700
commit679d35e42dfc3ae181167522dc1f171dcf008a84 (patch)
tree318c8b48b156e68b5188f65673132e5eef38745c /cobbler
parent039525e89dc30036bc8998f5b18f5729e0b2b8f9 (diff)
parent8cdc8d9c48e55846adf9c85f9b9d57c0b2483d72 (diff)
downloadthird_party-cobbler-679d35e42dfc3ae181167522dc1f171dcf008a84.tar.gz
third_party-cobbler-679d35e42dfc3ae181167522dc1f171dcf008a84.tar.xz
third_party-cobbler-679d35e42dfc3ae181167522dc1f171dcf008a84.zip
Merge latest
Diffstat (limited to 'cobbler')
-rw-r--r--cobbler/action_import.py15
-rw-r--r--cobbler/action_sync.py57
-rwxr-xr-xcobbler/cobbler.py11
-rw-r--r--cobbler/cobbler_msg.py14
-rw-r--r--cobbler/collection_profiles.py2
-rw-r--r--cobbler/item_profile.py118
-rw-r--r--cobbler/settings.py44
7 files changed, 130 insertions, 131 deletions
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index 486842e..69bfa97 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -85,19 +85,18 @@ class Importer:
if self.path and not os.path.isdir(self.path):
raise cexceptions.CobblerException("import_failed","bad path")
if self.mirror is not None:
+ if not self.mirror.startswith("rsync://"):
+ raise cexceptions.CobblerException("import_failed","expecting rsync:// url")
if self.mirror_name is None:
raise cexceptions.CobblerException("import_failed","must specify --mirror-name")
print "This will take a while..."
self.path = "/var/www/cobbler/localmirror/%s" % self.mirror_name
try:
- os.makedirs(self.path)
+ os.mkdir(self.path)
except:
if not os.path.exists(self.path):
raise cexceptions.CobblerException("couldn't create: %s" % (self.path))
- spacer = ""
- if not self.mirror.startswith("rsync://"):
- spacer = ' -e "ssh" '
- cmd = "rsync -az %s %s /var/www/cobbler/localmirror/%s --progress" % (spacer, self.mirror, self.mirror_name)
+ cmd = "rsync -az %s /var/www/cobbler/localmirror/%s --progress" % (self.mirror, self.mirror_name)
sub_process.call(cmd,shell=True)
update_file = open(os.path.join(self.path,"update.sh"),"w+")
update_file.write("#!/bin/sh")
@@ -187,7 +186,7 @@ class Importer:
if tentative == filter_out:
fnames.remove(tentative)
print "%s" % dirname
- if not self.is_pxe_or_virt_dir(dirname):
+ if not self.is_pxe_or_xen_dir(dirname):
return
for x in fnames:
if x.startswith("initrd"):
@@ -236,8 +235,8 @@ class Importer:
return "x86"
return "x86"
- def is_pxe_or_virt_dir(self,dirname):
- if dirname.find("pxe") != -1 or dirname.find("xen") != -1 or dirname.find("virt") != -1:
+ def is_pxe_or_xen_dir(self,dirname):
+ if dirname.find("pxe") != -1 or dirname.find("xen") != -1:
return True
return False
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index fb7697a..23e5660 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -153,7 +153,7 @@ class BootSync:
cobbler infrastructure available over TFTP over HTTP also.
"""
if not os.path.exists("/etc/httpd/conf.d"):
- print cobbler_msg.lookup("no_httpd")
+ self.sync_log(cobbler_msg.lookup("no_httpd"))
return
f = self.open_file("/etc/httpd/conf.d/cobbler.conf","w+")
config_data = """
@@ -172,15 +172,14 @@ class BootSync:
config_data = config_data.replace("/cobbler_webdir",self.settings.webdir)
self.tee(f, config_data)
self.close_file(f)
- sub_process.call("/sbin/service httpd reload", shell=True)
def clean_trees(self):
"""
- Delete any previously built pxelinux.cfg tree and virt tree info.
+ Delete any previously built pxelinux.cfg tree and xen tree info.
Note: for SELinux reasons, some information goes in /tftpboot, some in /var/www/cobbler
and some must be duplicated in both. This is because PXE needs tftp, and auto-kickstart
- and Virt operations need http. Only the kernel and initrd images are duplicated, which is
+ and Xen operations need http. Only the kernel and initrd images are duplicated, which is
unfortunate, though SELinux won't let me give them two contexts, so symlinks are not
a solution. *Otherwise* duplication is minimal.
"""
@@ -246,7 +245,7 @@ class BootSync:
def validate_kickstarts_per_profile(self):
"""
- Koan provisioning (Virt + auto-ks) needs kickstarts
+ Koan provisioning (Xen + auto-ks) needs kickstarts
per profile. Validate them as needed. Local kickstarts
get template substitution. Since http:// kickstarts might
get generated via magic URLs, those are *not* substituted.
@@ -260,6 +259,7 @@ class BootSync:
for g in self.profiles:
distro = self.distros.find(g.distro)
+ self.sync_log(cobbler_msg.lookup("sync_mirror_ks"))
kickstart_path = utils.find_kickstart(g.kickstart)
if kickstart_path and os.path.exists(kickstart_path):
# the input is an *actual* file, hence we have to copy it
@@ -323,8 +323,7 @@ class BootSync:
data = fd.read()
fd.close()
for x in metadata.keys():
- if x != "":
- data = data.replace("TEMPLATE::%s" % x, metadata[x])
+ data = data.replace("TEMPLATE::%s" % x, metadata[x])
fd = open(out_path, "w+")
fd.write(data)
fd.close()
@@ -333,19 +332,21 @@ class BootSync:
"""
Now that kernels and initrds are copied and kickstarts are all valid,
build the pxelinux.cfg tree, which contains a directory for each
- configured IP or MAC address. Also build a tree for Virt info.
+ configured IP or MAC address. Also build a tree for Xen info.
NOTE: some info needs to go in TFTP and HTTP directories, but not all.
Usually it's just one or the other.
"""
+ self.sync_log(cobbler_msg.lookup("sync_buildtree"))
self.write_listings()
# create pxelinux.cfg under tftpboot
# and file for each MAC or IP (hex encoded 01-XX-XX-XX-XX-XX-XX)
for d in self.distros:
+ self.sync_log(cobbler_msg.lookup("sync_processing") % d.name)
# TODO: add check to ensure all distros have profiles (=warning)
filename = os.path.join(self.settings.webdir,"distros",d.name)
d.kernel_options = self.blend_options(True,(
@@ -356,6 +357,7 @@ class BootSync:
self.write_distro_file(filename,d)
for p in self.profiles:
+ self.sync_log(cobbler_msg.lookup("sync_processing") % p.name)
# TODO: add check to ensure all profiles have distros (=error)
# TODO: add check to ensure all profiles have systems (=warning)
filename = os.path.join(self.settings.webdir,"profiles",p.name)
@@ -370,6 +372,7 @@ class BootSync:
self.write_profile_file(filename,p)
for system in self.systems:
+ self.sync_log(cobbler_msg.lookup("sync_processing") % system.name)
profile = self.profiles.find(system.profile)
if profile is None:
raise cexceptions.CobblerException("orphan_profile2",system.name,system.profile)
@@ -433,6 +436,8 @@ class BootSync:
kernel_path = os.path.join("/images",distro.name,os.path.basename(distro.kernel))
initrd_path = os.path.join("/images",distro.name,os.path.basename(distro.initrd))
kickstart_path = profile.kickstart
+ self.sync_log(cobbler_msg.lookup("writing") % filename)
+ self.sync_log("---------------------------------")
fd = self.open_file(filename,"w+")
if not is_ia64:
# pxelinux tree
@@ -468,8 +473,8 @@ class BootSync:
# kickstart path (if kickstart is used)
if kickstart_path is not None and kickstart_path != "":
# if kickstart path is on disk, we've already copied it into
- # the HTTP mirror, so make it something anaconda can get at.
- if kickstart_path.startswith("/") or kickstart_path.find("/cobbler/kickstarts/") != -1:
+ # the HTTP mirror, so make it something anaconda can get at
+ if kickstart_path.startswith("/"):
pxe_fn = self.get_pxe_filename(system.name)
kickstart_path = "http://%s/cobbler/kickstarts_sys/%s/ks.cfg" % (self.settings.server, pxe_fn)
append_line = "%s ks=%s" % (append_line, kickstart_path)
@@ -483,6 +488,7 @@ class BootSync:
self.tee(fd, "\tappend=\"%s\"" % append_line)
self.close_file(fd)
+ self.sync_log("--------------------------------")
def write_listings(self):
"""
@@ -499,10 +505,11 @@ class BootSync:
self.tee(fd2, data2)
self.close_file(fd1)
self.close_file(fd2)
+ self.sync_log("--------------------------------")
def write_distro_file(self,filename,distro):
"""
- Create distro information for virt install
+ Create distro information for xen-net-install
NOTE: relevant to http only
"""
@@ -515,7 +522,7 @@ class BootSync:
def write_profile_file(self,filename,profile):
"""
- Create profile information for virt install
+ Create profile information for xen-net-install
NOTE: relevant to http only
"""
@@ -530,7 +537,7 @@ class BootSync:
def write_system_file(self,filename,system):
"""
- Create system information for virt install
+ Create system information for xen-net-install
NOTE: relevant to http only
"""
@@ -542,8 +549,7 @@ class BootSync:
"""
For dryrun support: send data to screen and potentially to disk
"""
- if self.dryrun:
- print text
+ self.sync_log(text)
if not self.dryrun:
fd.write(text)
@@ -566,7 +572,7 @@ class BootSync:
"""
For dryrun support: potentially copy a file.
"""
- print "%s -> %s" % (src,dst)
+ self.sync_log(cobbler_msg.lookup("copying") % (src,dst))
if self.dryrun:
return True
try:
@@ -579,7 +585,7 @@ class BootSync:
"""
For dryrun support: potentially copy a file.
"""
- print "%s -> %s" % (src,dst)
+ self.sync_log(cobbler_msg.lookup("copying") % (src,dst))
if self.dryrun:
return True
try:
@@ -605,7 +611,7 @@ class BootSync:
"""
For dryrun support: potentially delete a tree.
"""
- print "del %s" % (path)
+ self.sync_log(cobbler_msg.lookup("removing") % (path))
if self.dryrun:
return True
try:
@@ -618,8 +624,8 @@ class BootSync:
"""
For dryrun support: potentially make a directory.
"""
+ self.sync_log(cobbler_msg.lookup("mkdir") % (path))
if self.dryrun:
- print "mkdir %s" % (path)
return True
try:
return os.makedirs(path,mode)
@@ -627,6 +633,19 @@ class BootSync:
if not oe.errno == 17: # already exists (no constant for 17?)
raise cexceptions.CobblerException("no_create", path)
+ def sync_log(self,message):
+ """
+ Used to differentiate dryrun output from the real thing
+ automagically
+ """
+ if self.verbose:
+ if self.dryrun:
+ if not message:
+ message = ""
+ print cobbler_msg.lookup("dryrun") % str(message)
+ else:
+ print message
+
def blend_options(self, is_for_kernel, list_of_opts):
"""
Given a list of options, take the values used by the
diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py
index aa64ff4..7186b5c 100755
--- a/cobbler/cobbler.py
+++ b/cobbler/cobbler.py
@@ -210,13 +210,12 @@ class BootCLI:
'--kickstart' : lambda(a) : profile.set_kickstart(a),
'--kick-start' : lambda(a) : profile.set_kickstart(a),
'--kopts' : lambda(a) : profile.set_kernel_options(a),
- '--xen-name' : lambda(a) : profile.set_virt_name(a),
- '--virt-name' : lambda(a) : profile.set_virt_name(a),
- '--xen-file-size' : lambda(a) : profile.set_virt_file_size(a),
- '--virt-file-size' : lambda(a) : profile.set_virt_file_size(a),
- '--xen-ram' : lambda(a) : profile.set_virt_ram(a),
- '--virt-ram' : lambda(a) : profile.set_virt_ram(a),
+ '--xen-name' : lambda(a) : profile.set_xen_name(a),
+ '--xen-file-size' : lambda(a) : profile.set_xen_file_size(a),
+ '--xen-ram' : lambda(a) : profile.set_xen_ram(a),
'--ksmeta' : lambda(a) : profile.set_ksmeta(a)
+ # the following options are most likely not useful for profiles (yet)
+ # '--xen-paravirt' : lambda(a) : profile.set_xen_paravirt(a),
}
on_ok = lambda: self.api.profiles().add(profile)
return self.apply_args(args,commands,on_ok)
diff --git a/cobbler/cobbler_msg.py b/cobbler/cobbler_msg.py
index 0181439..a77e537 100644
--- a/cobbler/cobbler_msg.py
+++ b/cobbler/cobbler_msg.py
@@ -26,8 +26,8 @@ cobbler distro add --name=<string> --kernel=<path> --initrd=<path>
cobbler profile add --name=<string --distro=<string>
[--kick-start=<url>] [--kopts=<string>] [--ksmeta=<string>]
- [--virt-name=<string>] [--virt-file-size=<gigabytes>]
- [--virt-ram=<megabytes>]
+ [--xen-name=<string>] [--xen-file-size=<gigabytes>]
+ [--xen-ram=<megabytes>]
cobbler system add --name=<ip│mac│hostname|default> --profile=<string>
[--pxe-address=<string>]
@@ -103,11 +103,11 @@ _msg_table = {
"copying" : "copying file: %s to %s",
"removing" : "removing: %s",
"no_initrd" : "cannot find initrd",
- "exc_virt_name" : "invalid name for virtual image",
- "exc_virt_file" : "invalid file size for virtual image",
- "exc_virt_ram" : "invalid RAM size for virtual image",
- "exc_virt_mac" : "invalid MAC address for virtual image",
- "exc_virt_para" : "invalid paravirtualization setting",
+ "exc_xen_name" : "invalid Xen name",
+ "exc_xen_file" : "invalid Xen file size",
+ "exc_xen_ram" : "invalid Xen RAM size",
+ "exc_xen_mac" : "invalid Xen mac address",
+ "exc_xen_para" : "invalid Xen paravirtualization setting",
"exc_profile" : "invalid profile name",
"exc_profile2" : "profile name not set",
"exc_pxe_arch" : "valid PXE architectures: standard or ia64",
diff --git a/cobbler/collection_profiles.py b/cobbler/collection_profiles.py
index 717d19c..71cbd9f 100644
--- a/cobbler/collection_profiles.py
+++ b/cobbler/collection_profiles.py
@@ -1,7 +1,7 @@
"""
A profile represents a distro paired with a kickstart file.
For instance, FC5 with a kickstart file specifying OpenOffice
-might represent a 'desktop' profile. For Virt, there are many
+might represent a 'desktop' profile. For Xen, there are many
additional options, with client-side defaults (not kept here).
Copyright 2006, Red Hat, Inc
diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py
index 311b54f..9b9edc5 100644
--- a/cobbler/item_profile.py
+++ b/cobbler/item_profile.py
@@ -1,5 +1,5 @@
"""
-A Cobbler Profile. A profile is a reference to a distribution, possibly some kernel options, possibly some Virt options, and some kickstart data.
+A Cobbler Profile. A profile is a reference to a distribution, possibly some kernel options, possibly some Xen options, and some kickstart data.
Copyright 2006, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
@@ -23,7 +23,6 @@ class Profile(item.Item):
Constructor. Requires a backreference to Config.
"""
self.config = config
- self.settings = self.config.settings()
self.clear()
def clear(self):
@@ -32,13 +31,13 @@ class Profile(item.Item):
"""
self.name = None
self.distro = None # a name, not a reference
- self.kickstart = self.settings.default_kickstart
+ self.kickstart = None
self.kernel_options = ''
self.ks_meta = ''
- self.virt_name = 'virtguest'
- self.virt_file_size = 5 # GB. 5 = Decent _minimum_ default for FC5.
- self.virt_ram = 512 # MB. Install with 256 not likely to pass
- self.virt_paravirt = True # hvm support is *NOT* in Koan (now)
+ self.xen_name = 'xenguest'
+ self.xen_file_size = 5 # GB. 5 = Decent _minimum_ default for FC5.
+ self.xen_ram = 512 # MB. Install with 256 not likely to pass
+ self.xen_paravirt = True # hvm support is *NOT* in Koan (now)
def from_datastruct(self,seed_data):
"""
@@ -49,22 +48,12 @@ class Profile(item.Item):
self.kickstart = self.load_item(seed_data,'kickstart')
self.kernel_options = self.load_item(seed_data,'kernel_options')
self.ks_meta = self.load_item(seed_data,'ks_meta')
-
- # virt specific
- self.virt_name = self.load_item(seed_data,'virt_name')
- self.virt_ram = self.load_item(seed_data,'virt_ram')
- self.virt_file_size = self.load_item(seed_data,'virt_file_size')
- self.virt_paravirt = self.load_item(seed_data,'virt_paravirt')
-
- # support for older versions of the cobbler files (backwards compat)...
- self.virt_name = self.load_item(seed_data,'xen_name')
- if not self.virt_name or self.virt_name == '':
- self.virt_name = self.name
- self.virt_ram = self.load_item(seed_data,'xen_ram')
- self.virt_file_size = self.load_item(seed_data,'xen_file_size')
- self.virt_paravirt = self.load_item(seed_data,'xen_paravirt')
-
-
+ self.xen_name = self.load_item(seed_data,'xen_name')
+ if not self.xen_name or self.xen_name == '':
+ self.xen_name = self.name
+ self.xen_ram = self.load_item(seed_data,'xen_ram')
+ self.xen_file_size = self.load_item(seed_data,'xen_file_size')
+ self.xen_paravirt = self.load_item(seed_data,'xen_paravirt')
return self
def set_distro(self,distro_name):
@@ -87,11 +76,11 @@ class Profile(item.Item):
return True
raise cexceptions.CobblerException("no_kickstart")
- def set_virt_name(self,str):
+ def set_xen_name(self,str):
"""
- For Virt only.
- Specifies what virt install should use for --name.
- virt install may do conflict resolution, so this is mostly
+ For Xen only.
+ Specifies what xenguest install should use for --name.
+ xen-net-install may do conflict resolution, so this is mostly
a hint... To keep the shell happy, the 'str' cannot
contain wildcards or slashes and may be subject to some other
untainting later.
@@ -99,14 +88,14 @@ class Profile(item.Item):
# no slashes or wildcards
for bad in [ '/', '*', '?' ]:
if str.find(bad) != -1:
- raise cexceptions.CobblerException("exc_virt_name")
- self.virt_name = str
+ raise cexceptions.CobblerException("exc_xen_name")
+ self.xen_name = str
return True
-
- def set_virt_file_size(self,num):
+
+ def set_xen_file_size(self,num):
"""
- For Virt only.
- Specifies the size of the virt image in gigabytes. koan
+ For Xen only.
+ Specifies the size of the Xen image in gigabytes. xen-net-install
may contain some logic to ignore 'illogical' values of this size,
though there are no guarantees. 0 tells koan to just
let it pick a semi-reasonable size. When in doubt, specify the
@@ -116,35 +105,36 @@ class Profile(item.Item):
try:
inum = int(num)
if inum != float(num):
- return cexceptions.CobblerException("exc_virt_file")
+ return cexceptions.CobblerException("exc_xen_file")
if inum >= 0:
- self.virt_file_size = inum
+ self.xen_file_size = inum
return True
- return cexceptions.CobblerException("exc_virt_file")
+ return cexceptions.CobblerException("exc_xen_file")
except:
- return cexceptions.CobblerException("exc_virt_file")
+ return cexceptions.CobblerException("exc_xen_file")
- def set_virt_ram(self,num):
+ def set_xen_ram(self,num):
"""
- For Virt only.
- Specifies the size of the Virt RAM in MB.
+ For Xen only.
+ Specifies the size of the Xen RAM in MB.
0 tells Koan to just choose a reasonable default.
"""
# num is a non-negative integer (0 means default)
try:
inum = int(num)
if inum != float(num):
- return cexceptions.CobblerException("exc_virt_ram")
+ return cexceptions.CobblerException("exc_xen_ram")
if inum >= 0:
- self.virt_ram = inum
+ self.xen_ram = inum
return True
- return cexceptions.CobblerException("exc_virt_ram")
+ return cexceptions.CobblerException("exc_xen_ram")
except:
- return cexceptions.CobblerException("exc_virt_ram")
+ return cexceptions.CobblerException("exc_xen_ram")
+
- def set_virt_paravirt(self,truthiness):
+ def set_xen_paravirt(self,truthiness):
"""
- For Virt only.
+ For Xen only.
Specifies whether the system is a paravirtualized system or not.
For ordinary computers, you want to pick 'true'. Method accepts string
'true'/'false' in all cases, or Python True/False.
@@ -154,19 +144,19 @@ class Profile(item.Item):
# the string "foosball" is True, and that is not a valid argument for this function
try:
if (not truthiness or truthiness.lower() == 'false'):
- self.virt_paravirt = False
+ self.xen_paravirt = False
elif (truthiness or truthiness.lower() == 'true'):
- self.virt_paravirt = True
+ self.xen_paravirt = True
else:
- return cexceptions.CobblerException("exc_virt_para")
+ return cexceptions.CobblerException("exc_xen_para")
except:
- return cexceptions.CobblerException("exc_virt_para")
+ return cexceptions.CobblerException("exc_xen_para")
return True
def is_valid(self):
"""
A profile only needs a name and a distro. Kickstart info,
- as well as Virt info, are optional. (Though I would say provisioning
+ as well as Xen info, are optional. (Though I would say provisioning
without a kickstart is *usually* not a good idea).
"""
for x in (self.name, self.distro):
@@ -179,15 +169,15 @@ class Profile(item.Item):
Return hash representation for the serializer
"""
return {
- 'name' : self.name,
- 'distro' : self.distro,
- 'kickstart' : self.kickstart,
- 'kernel_options' : self.kernel_options,
- 'virt_name' : self.virt_name,
- 'virt_file_size' : self.virt_file_size,
- 'virt_ram' : self.virt_ram,
- 'virt_paravirt' : self.virt_paravirt,
- 'ks_meta' : self.ks_meta
+ 'name' : self.name,
+ 'distro' : self.distro,
+ 'kickstart' : self.kickstart,
+ 'kernel_options' : self.kernel_options,
+ 'xen_name' : self.xen_name,
+ 'xen_file_size' : self.xen_file_size,
+ 'xen_ram' : self.xen_ram,
+ 'xen_paravirt' : self.xen_paravirt,
+ 'ks_meta' : self.ks_meta
}
def printable(self,id):
@@ -199,9 +189,9 @@ class Profile(item.Item):
buf = buf + "kickstart : %s\n" % self.kickstart
buf = buf + "kernel options : %s\n" % self.kernel_options
buf = buf + "ks metadata : %s\n" % self.ks_meta
- buf = buf + "virt name : %s\n" % self.virt_name
- buf = buf + "virt file size : %s\n" % self.virt_file_size
- buf = buf + "virt ram : %s\n" % self.virt_ram
- buf = buf + "virt paravirt : %s\n" % self.virt_paravirt
+ buf = buf + "xen name : %s\n" % self.xen_name
+ buf = buf + "xen file size : %s\n" % self.xen_file_size
+ buf = buf + "xen ram : %s\n" % self.xen_ram
+ buf = buf + "xen paravirt : %s\n" % self.xen_paravirt
return buf
diff --git a/cobbler/settings.py b/cobbler/settings.py
index 4b2c4df..9e03666 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -17,27 +17,6 @@ import utils
TESTMODE = False
-DEFAULTS = {
- "httpd_bin" : "/usr/sbin/httpd",
- "dhcpd_conf" : "/etc/dhcpd.conf",
- "tftpd_bin" : "/usr/sbin/in.tftpd",
- "server" : "127.0.0.1",
- "next_server" : "127.0.0.1",
- "dhcpd_bin" : "/usr/sbin/dhcpd",
- "kernel_options" : "append devfs=nomount ramdisk_size=16438 lang= text ksdevice=eth0",
- "tftpd_conf" : "/etc/xinetd.d/tftp",
- "tftpboot" : "/tftpboot",
- "webdir" : "/var/www/cobbler",
- "default_kickstart" : "/etc/cobbler/default.ks",
- "manage_dhcp" : 0,
- "koan_path" : "",
- "bootloaders" : {
- "standard" : "/usr/lib/syslinux/pxelinux.0",
- "ia64" : "/var/lib/cobbler/elilo-3.6-ia64.efi"
- }
-}
-
-
class Settings(serializable.Serializable):
def filename(self):
@@ -59,7 +38,24 @@ class Settings(serializable.Serializable):
"""
Reset this object to reasonable default values.
"""
- self._attributes = DEFAULTS
+ self._attributes = {
+ "httpd_bin" : "/usr/sbin/httpd",
+ "dhcpd_conf" : "/etc/dhcpd.conf",
+ "tftpd_bin" : "/usr/sbin/in.tftpd",
+ "server" : "127.0.0.1",
+ "next_server" : "127.0.0.1",
+ "dhcpd_bin" : "/usr/sbin/dhcpd",
+ "kernel_options" : "append devfs=nomount ramdisk_size=16438 lang= vga=788 ksdevice=eth0",
+ "tftpd_conf" : "/etc/xinetd.d/tftp",
+ "tftpboot" : "/tftpboot",
+ "webdir" : "/var/www/cobbler",
+ "manage_dhcp" : 0,
+ "koan_path" : "",
+ "bootloaders" : {
+ "standard" : "/usr/lib/syslinux/pxelinux.0",
+ "ia64" : "/var/lib/cobbler/elilo-3.6-ia64.efi"
+ }
+ }
def printable(self):
buf = ""
@@ -86,10 +82,6 @@ class Settings(serializable.Serializable):
def __getattr__(self,name):
if self._attributes.has_key(name):
return self._attributes[name]
- elif DEFAULTS.has_key(name):
- lookup = DEFAULTS[name]
- self._attributes[name] = lookup
- return lookup
else:
raise AttributeError, name