summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-05-16 14:42:37 -0400
committerMichael DeHaan <mdehaan@redhat.com>2008-05-16 14:42:37 -0400
commit90666a4a0a3c918a31f7cdfd9fa9fd2a6ad48705 (patch)
tree2b135312747da84917c25486d90b57b6be5e9ccd
parent17f0ac054ef5bf160909095aaf119931edd5c39c (diff)
downloadthird_party-cobbler-90666a4a0a3c918a31f7cdfd9fa9fd2a6ad48705.tar.gz
third_party-cobbler-90666a4a0a3c918a31f7cdfd9fa9fd2a6ad48705.tar.xz
third_party-cobbler-90666a4a0a3c918a31f7cdfd9fa9fd2a6ad48705.zip
The settings file is now /etc/cobbler/settings, and cobbler's command line
will warn the user the old file is no longer in use and ask them to delete it before proceeding.
-rw-r--r--CHANGELOG1
-rw-r--r--Makefile16
-rw-r--r--cobbler.spec5
-rw-r--r--cobbler/action_check.py10
-rw-r--r--cobbler/api.py2
-rwxr-xr-xcobbler/cobbler.py11
-rw-r--r--cobbler/item_system.py2
-rw-r--r--cobbler/pxegen.py2
-rw-r--r--cobbler/remote.py2
-rw-r--r--cobbler/settings.py8
-rw-r--r--setup.py2
11 files changed, 33 insertions, 28 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 8e01199..d43d434 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -17,6 +17,7 @@ Cobbler CHANGELOG
- it's now possible to undefine a --ksmeta or kopts symbol defined in a parent with "!foo"
- log errors while rendering kickstarts
- comments added to the config file, neat!
+- settings file is now /etc/cobbler/settings
- Fri May 09 2008 - 0.9.1
- patch to allow yumopts to override gpgcheck
diff --git a/Makefile b/Makefile
index 3407721..d7fd78c 100644
--- a/Makefile
+++ b/Makefile
@@ -36,17 +36,17 @@ install: clean manpage
python setup.py install -f
devinstall:
- cp /var/lib/cobbler/settings /tmp/cobbler_settings
- cp /etc/cobbler/modules.conf /tmp/cobbler_modules.conf
- cp /etc/httpd/conf.d/cobbler.conf /tmp/cobbler_http.conf
- cp /etc/cobbler/users.conf /tmp/cobbler_users.conf
+ -cp /etc/cobbler/settings /tmp/cobbler_settings
+ -cp /etc/cobbler/modules.conf /tmp/cobbler_modules.conf
+ -cp /etc/httpd/conf.d/cobbler.conf /tmp/cobbler_http.conf
+ -cp /etc/cobbler/users.conf /tmp/cobbler_users.conf
-cp /etc/cobbler/users.digest /tmp/cobbler_users.digest
make install
- cp /tmp/cobbler_settings /var/lib/cobbler/settings
- cp /tmp/cobbler_modules.conf /etc/cobbler/modules.conf
- cp /tmp/cobbler_users.conf /etc/cobbler/users.conf
+ -cp /tmp/cobbler_settings /etc/cobbler/settings
+ -cp /tmp/cobbler_modules.conf /etc/cobbler/modules.conf
+ -cp /tmp/cobbler_users.conf /etc/cobbler/users.conf
-cp /tmp/cobbler_users.digest /etc/cobbler/users.digest
- cp /tmp/cobbler_http.conf /etc/httpd/conf.d/cobbler.conf
+ -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
diff --git a/cobbler.spec b/cobbler.spec
index 51ea3aa..c4284f3 100644
--- a/cobbler.spec
+++ b/cobbler.spec
@@ -169,7 +169,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%config(noreplace) /var/lib/cobbler/triggers/install/post/status_post.trigger
%defattr(664,root,root)
-%config(noreplace) /var/lib/cobbler/settings
+%config(noreplace) /etc/cobbler/settings
%config(noreplace) /var/lib/cobbler/snippets/partition_select
/var/lib/cobbler/elilo-3.6-ia64.efi
/var/lib/cobbler/menu.c32
@@ -188,8 +188,9 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%changelog
-* Mon May 12 2008 Michael DeHaan <mdehaan@redhat.com> - 0.9.2-1
+* Fri May 16 2008 Michael DeHaan <mdehaan@redhat.com> - 0.9.2-1
- Upstream changes (see CHANGELOG)
+- moved /var/lib/cobbler/settings to /etc/cobbler/settings
* Fri May 09 2008 Michael DeHaan <mdehaan@redhat.com> - 0.9.1-1
- Upstream changes (see CHANGELOG)
diff --git a/cobbler/action_check.py b/cobbler/action_check.py
index f5f86f0..d38603b 100644
--- a/cobbler/action_check.py
+++ b/cobbler/action_check.py
@@ -106,9 +106,9 @@ class BootCheck:
parameters.
"""
if self.settings.server == "127.0.0.1":
- status.append(_("The 'server' field in /var/lib/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it."))
+ status.append(_("The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it."))
if self.settings.next_server == "127.0.0.1":
- status.append(_("For PXE to be functional, the 'next_server' field in /var/lib/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network."))
+ status.append(_("For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network."))
def check_selinux(self,status):
prc = sub_process.Popen("/usr/sbin/getenforce",shell=True,stdout=sub_process.PIPE)
@@ -175,21 +175,21 @@ class BootCheck:
Check if dhcpd is installed
"""
if not os.path.exists(self.settings.dhcpd_bin):
- status.append(_("dhcpd isn't installed, but management is enabled in /var/lib/cobbler/settings"))
+ status.append(_("dhcpd isn't installed, but management is enabled in /etc/cobbler/settings"))
def check_dnsmasq_bin(self,status):
"""
Check if dnsmasq is installed
"""
if not os.path.exists(self.settings.dnsmasq_bin):
- status.append(_("dnsmasq isn't installed, but management is enabled in /var/lib/cobbler/settings"))
+ status.append(_("dnsmasq isn't installed, but management is enabled in /etc/cobbler/settings"))
def check_bind_bin(self,status):
"""
Check if bind is installed.
"""
if not os.path.exists(self.settings.bind_bin):
- status.append(_("bind isn't installed, but management is enabled in /var/lib/cobbler/settings"))
+ status.append(_("bind isn't installed, but management is enabled in /etc/cobbler/settings"))
def check_bootloaders(self,status):
diff --git a/cobbler/api.py b/cobbler/api.py
index cafc216..9f4a636 100644
--- a/cobbler/api.py
+++ b/cobbler/api.py
@@ -41,7 +41,7 @@ DEBUG = 5
# notes on locking:
# BootAPI is a singleton object
# the XMLRPC variants allow 1 simultaneous request
-# therefore we flock on /var/lib/cobbler/settings for now
+# therefore we flock on /etc/cobbler/settings for now
# on a request by request basis.
class BootAPI:
diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py
index 970a06a..2aed672 100755
--- a/cobbler/cobbler.py
+++ b/cobbler/cobbler.py
@@ -45,12 +45,23 @@ class BootCLI:
####################################################
+def run_upgrade_checks():
+ """
+ Cobbler tries to make manual upgrade steps unneeded, though
+ this function serves to inform users of manual steps when they /are/
+ needed.
+ """
+ # for users running pre-1.0 upgrading to 1.0
+ if os.path.exists("/var/lib/cobbler/settings"):
+ raise CX(_("/var/lib/cobbler/settings is no longer in use, remove this file to acknowledge you have migrated your configuration to /etc/cobbler/settings. Do not simply copy the file over or you will lose new configuration entries. Run 'cobbler check' and then 'cobbler sync' after making changes."))
+
def main():
"""
CLI entry point
"""
exitcode = 0
try:
+ run_upgrade_checks()
return BootCLI().run(sys.argv)
except SystemExit, ex:
return 1
diff --git a/cobbler/item_system.py b/cobbler/item_system.py
index 2318ced..09f169d 100644
--- a/cobbler/item_system.py
+++ b/cobbler/item_system.py
@@ -249,7 +249,7 @@ class System(item.Item):
def set_ip_address(self,address,interface="intf0"):
"""
Assign a IP or hostname in DHCP when this MAC boots.
- Only works if manage_dhcp is set in /var/lib/cobbler/settings
+ Only works if manage_dhcp is set in /etc/cobbler/settings
"""
intf = self.__get_interface(interface)
if address == "" or utils.is_ip(address):
diff --git a/cobbler/pxegen.py b/cobbler/pxegen.py
index d847569..a438583 100644
--- a/cobbler/pxegen.py
+++ b/cobbler/pxegen.py
@@ -58,7 +58,7 @@ class PXEGen:
"""
Copy bootloaders to the configured tftpboot directory
NOTE: we support different arch's if defined in
- /var/lib/cobbler/settings.
+ /etc/cobbler/settings.
"""
for loader in self.settings.bootloaders.keys():
path = self.settings.bootloaders[loader]
diff --git a/cobbler/remote.py b/cobbler/remote.py
index 69754a3..1a414f3 100644
--- a/cobbler/remote.py
+++ b/cobbler/remote.py
@@ -193,7 +193,7 @@ class CobblerXMLRPCInterface:
def get_settings(self,token=None):
"""
- Return the contents of /var/lib/cobbler/settings, which is a hash.
+ Return the contents of /etc/cobbler/settings, which is a hash.
"""
self.log("get_settings",token=token)
return self.__get_all("settings")
diff --git a/cobbler/settings.py b/cobbler/settings.py
index d147d4b..4670ab0 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -140,11 +140,3 @@ class Settings(serializable.Serializable):
else:
raise AttributeError, name
-if __name__ == "__main__":
- # used to save a settings file to /var/lib/cobbler/settings, for purposes of
- # including a new updated settings file in the RPM without remembering how
- # to format lots of YAML.
- import yaml
- print yaml.dump(DEFAULTS)
-
-
diff --git a/setup.py b/setup.py
index 7b11c78..c659f9a 100644
--- a/setup.py
+++ b/setup.py
@@ -80,7 +80,7 @@ if __name__ == "__main__":
(etcpath, ['config/rsync.exclude']),
(etcpath, ['config/users.conf']),
(initpath, ['config/cobblerd']),
- (cobpath, ['config/settings']),
+ (etcpath, ['config/settings']),
# backups for upgrades
(backpath, []),