summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-06-25 15:02:17 -0400
committerMichael DeHaan <mdehaan@redhat.com>2008-06-25 15:02:17 -0400
commit073364be452451b2b7f24083ae421aaea73efb12 (patch)
tree4b681346a6620c4603b4d87b9b70313d859f26c2
parent2b46cb9afc164804a2466a58c575d1d3a2f22955 (diff)
parent1e7b1b8ba5a982ca801a4d8246934a2315dd5931 (diff)
downloadcobbler-073364be452451b2b7f24083ae421aaea73efb12.tar.gz
cobbler-073364be452451b2b7f24083ae421aaea73efb12.tar.xz
cobbler-073364be452451b2b7f24083ae421aaea73efb12.zip
Merge branch 'master' into devel
Conflicts: CHANGELOG cobbler/action_replicate.py
-rw-r--r--CHANGELOG7
-rw-r--r--Makefile2
-rw-r--r--cobbler.spec6
-rw-r--r--cobbler/modules/manage_bind.py2
-rw-r--r--cobbler/modules/manage_isc.py3
-rw-r--r--cobbler/pxegen.py7
-rw-r--r--cobbler/remote.py2
-rw-r--r--cobbler/settings.py3
-rw-r--r--config/settings13
-rw-r--r--tests/tests.py11
-rw-r--r--triggers/restart-services.trigger31
11 files changed, 67 insertions, 20 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d8aba8ae..8c5562dd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -14,6 +14,13 @@ Cobbler CHANGELOG
- allow mod python bits to work via non-80 http ports
- Wed Jun 03 2008 - 1.0.3
+- Fix typo in replicate code
+- remove rhpl reference
+- scrub references to manage_*_mode and rewrite the restart-services trigger
+- add new settings to control whether the restart-trigger restarts things
+
+- Mon Jun 09 2008 - 1.0.2
+- Fix mkdir invocation
- Fix error message output from failed kickstart rendering
- manpage edits
- make buildiso work for SuSE
diff --git a/Makefile b/Makefile
index d7fd78cd..0089a03d 100644
--- a/Makefile
+++ b/Makefile
@@ -49,14 +49,12 @@ devinstall:
-cp /tmp/cobbler_http.conf /etc/httpd/conf.d/cobbler.conf
find /var/lib/cobbler/triggers | xargs chmod +x
chown -R apache /var/www/cobbler
- chown -R apache /var/www/cgi-bin/cobbler
chmod -R +x /var/www/cobbler/web
chmod -R +x /var/www/cobbler/svc
webtest: devinstall
/sbin/service cobblerd restart
/sbin/service httpd restart
- chmod +x /var/www/cgi-bin/cobbler/*.cgi
sdist: clean messages updatewui
python setup.py sdist
diff --git a/cobbler.spec b/cobbler.spec
index 53f5428c..f9786752 100644
--- a/cobbler.spec
+++ b/cobbler.spec
@@ -190,6 +190,12 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%changelog
+* Tue Jun 10 2008 Michael DeHaan <mdehaan@redhat.com> - 1.0.3-1
+- Upstream changes (see CHANGELOG)
+
+* Mon Jun 09 2008 Michael DeHaan <mdehaan@redhat.com> - 1.0.2-1
+- Upstream changes (see CHANGELOG)
+
* Tue Jun 03 2008 Michael DeHaan <mdehaan@redhat.com> - 1.0.1-1
- Upstream changes (see CHANGELOG)
- stop owning files in tftpboot
diff --git a/cobbler/modules/manage_bind.py b/cobbler/modules/manage_bind.py
index 339fbf07..d88c87ce 100644
--- a/cobbler/modules/manage_bind.py
+++ b/cobbler/modules/manage_bind.py
@@ -49,7 +49,7 @@ def register():
class BindManager:
def what(self):
- return "isc_and_bind"
+ return "bind"
def __init__(self,config,verbose=False):
"""
diff --git a/cobbler/modules/manage_isc.py b/cobbler/modules/manage_isc.py
index ba5f21cd..18295246 100644
--- a/cobbler/modules/manage_isc.py
+++ b/cobbler/modules/manage_isc.py
@@ -48,7 +48,7 @@ def register():
class IscManager:
def what(self):
- return "isc_and_bind"
+ return "isc"
def __init__(self,config,verbose=False):
"""
@@ -130,7 +130,6 @@ class IscManager:
settings_file = self.settings.dhcpd_conf
template_file = "/etc/cobbler/dhcp.template"
- mode = self.settings.manage_dhcp_mode.lower()
try:
f2 = open(template_file,"r")
diff --git a/cobbler/pxegen.py b/cobbler/pxegen.py
index 94bdb2ae..048e7add 100644
--- a/cobbler/pxegen.py
+++ b/cobbler/pxegen.py
@@ -127,11 +127,14 @@ class PXEGen:
f1 = utils.get_config_filename(system,interface=name)
+ if distro.arch is None or distro.arch == "":
+ distro.arch = "x86"
+
# for tftp only ...
if distro.arch in [ "i386", "x86", "x86_64", "standard"]:
# pxelinux wants a file named $name under pxelinux.cfg
f2 = os.path.join(self.bootloc, "pxelinux.cfg", f1)
- if distro.arch == "ia64":
+ elif distro.arch == "ia64":
# elilo expects files to be named "$name.conf" in the root
# and can not do files based on the MAC address
if ip is not None and ip != "":
@@ -139,6 +142,8 @@ class PXEGen:
filename = "%s.conf" % utils.get_config_filename(system,interface=name)
f2 = os.path.join(self.bootloc, filename)
+ else:
+ raise CX(_("Invalid arch %s, cobbler is confused") % distro.arch)
f3 = os.path.join(self.settings.webdir, "systems", f1)
diff --git a/cobbler/remote.py b/cobbler/remote.py
index 1a414f36..3d1a6a8f 100644
--- a/cobbler/remote.py
+++ b/cobbler/remote.py
@@ -18,7 +18,6 @@ import socket
import time
import os
import SimpleXMLRPCServer
-from rhpl.translate import _, N_, textdomain, utf8
import xmlrpclib
import random
import base64
@@ -33,6 +32,7 @@ import item_distro
import item_profile
import item_system
import item_repo
+from utils import *
# FIXME: make configurable?
TOKEN_TIMEOUT = 60*60 # 60 minutes
diff --git a/cobbler/settings.py b/cobbler/settings.py
index 1d6b0075..76adcd73 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -58,7 +58,6 @@ DEFAULTS = {
"ksdevice" : "eth0"
},
"manage_dhcp" : 0,
- "manage_dhcp_mode" : "isc",
"manage_dns" : 0,
"manage_forward_zones" : [],
"manage_reverse_zones" : [],
@@ -69,6 +68,8 @@ DEFAULTS = {
"omshell_bin" : "/usr/bin/omshell",
"pxe_just_once" : 0,
"register_new_installs" : 0,
+ "restart_dns" : 1,
+ "restart_dhcp" : 1,
"run_install_triggers" : 1,
"server" : "127.0.0.1",
"snippetsdir" : "/var/lib/cobbler/snippets",
diff --git a/config/settings b/config/settings
index 14517c18..bfc98a73 100644
--- a/config/settings
+++ b/config/settings
@@ -113,6 +113,19 @@ omshell_bin: /usr/bin/omshell
# for --netboot-enabled.
pxe_just_once: 0
+# when DHCP and DNS management are enabled, cobbler sync can automatically
+# restart those services to apply changes. The exception for this is
+# if using ISC for DHCP, then omapi eliminates the need for a restart.
+# If DHCP and DNS are going to be managed, but hosted on a box that
+# is not on this server, disable restarts here and write some other
+# script to ensure that the config files get copied/rsynced to the destination
+# box. This can be done by modifying the restart services trigger.
+# Note that if manage_dhcp and manage_dns are disabled, the respective
+# parameter will have no effect. Most users should not need to change
+# this.
+restart_dns: 1
+restart_dhcp: 1
+
# if set to 1, new systems doing profile based installations will
# contact cobbler to have system records created for them containing
# the mac address information that they have requested for install.
diff --git a/tests/tests.py b/tests/tests.py
index 02d53be5..7c4c6bf0 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -741,7 +741,11 @@ class SyncContents(BootTest):
converted="01-bb-ee-ee-ee-ee-ff"
- fh = open("/tftpboot/pxelinux.cfg/%s" % converted)
+ if os.path.exists("/var/lib/tftpboot"):
+ fh = open("/var/lib/tftpboot/pxelinux.cfg/%s" % converted)
+ else:
+ fh = open("/tftpboot/pxelinux.cfg/%s" % converted)
+
data = fh.read()
self.assertTrue(data.find("/op/ks/") != -1)
fh.close()
@@ -751,7 +755,10 @@ class SyncContents(BootTest):
# (which was an error we had in 0.6.3)
self.api.sync()
- fh = open("/tftpboot/pxelinux.cfg/%s" % converted)
+ if os.path.exists("/var/lib/tftpboot"):
+ fh = open("/var/lib/tftpboot/pxelinux.cfg/%s" % converted)
+ else:
+ fh = open("/tftpboot/pxelinux.cfg/%s" % converted)
data = fh.read()
self.assertTrue(data.find("/op/ks/") != -1)
fh.close()
diff --git a/triggers/restart-services.trigger b/triggers/restart-services.trigger
index d586f466..6eac017b 100644
--- a/triggers/restart-services.trigger
+++ b/triggers/restart-services.trigger
@@ -4,29 +4,40 @@ import cobbler.api as capi
import os
import sys
-#!/usr/bin/python
-
bootapi = capi.BootAPI()
settings = bootapi.settings()
manage_dhcp = str(settings.manage_dhcp).lower()
-manage_dhcp_mode = str(settings.manage_dhcp_mode).lower()
manage_dns = str(settings.manage_dns).lower()
+restart_dhcp = str(settings.restart_dhcp).lower()
+restart_dns = str(settings.restart_dns).lower()
omapi_enabled = settings.omapi_enabled
omapi_port = settings.omapi_port
+# load up our DHCP and DNS modules
+bootapi.get_sync()
+# bootapi.dhcp and bootapi.dns are now module references
+
+# special handling as we don't want to restart it twice
+has_restarted_dnsmasq = False
+
rc = 0
if manage_dhcp != "0":
- if manage_dhcp_mode == "isc":
- if not omapi_enabled:
+ if bootapi.dhcp.what() == "isc":
+ if not omapi_enabled and restart_dhcp:
rc = os.system("/sbin/service dhcpd restart")
- elif manage_dhcp_mode == "dnsmasq":
- rc = os.system("/sbin/service dnsmasq restart")
+ elif bootapi.dhcp.what() == "dnsmasq":
+ if restart_dhcp:
+ rc = os.system("/sbin/service dnsmasq restart")
+ has_restarted_dnsmasq = True
else:
- print "- error: unknown DHCP engine: %s" % manage_dhcp_mode
+ print "- error: unknown DHCP engine: %s" % bootapi.dhcp.what()
rc = 411
-if manage_dns != "0":
- rc = os.system("/sbin/service named restart")
+if manage_dns != "0" and restart_dns:
+ if bootapi.dns.what() == "bind":
+ rc = os.system("/sbin/service named restart")
+ elif bootapi.dns.what() == "dnsmasq" and not has_restarted_dnsmasq:
+ rc = os.ssytem("/sbin/service dnsmasq restart")
sys.exit(rc)