diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2009-08-10 15:23:27 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2009-08-10 15:23:27 -0400 |
commit | 48e67c5b23dca45d2ce89482b0ed9c2d2e9b7b02 (patch) | |
tree | 7984dcd233af9c16f822ede87fbb4c604dded2fb | |
parent | 4bb1d40ed0cf6c2371676d17712ded94fd9d02d2 (diff) | |
download | cobbler-48e67c5b23dca45d2ce89482b0ed9c2d2e9b7b02.tar.gz cobbler-48e67c5b23dca45d2ce89482b0ed9c2d2e9b7b02.tar.xz cobbler-48e67c5b23dca45d2ce89482b0ed9c2d2e9b7b02.zip |
Remove references to omapi and omshell (deprecated feature in 1.6, now removed)
-rw-r--r-- | cobbler/action_litesync.py | 18 | ||||
-rw-r--r-- | cobbler/modules/manage_dnsmasq.py | 2 | ||||
-rw-r--r-- | cobbler/modules/manage_isc.py | 89 | ||||
-rw-r--r-- | cobbler/modules/sync_post_restart_services.py | 4 | ||||
-rw-r--r-- | cobbler/settings.py | 3 | ||||
-rw-r--r-- | installer_templates/settings.template | 9 | ||||
-rw-r--r-- | templates/dhcp.template | 3 |
7 files changed, 1 insertions, 127 deletions
diff --git a/cobbler/action_litesync.py b/cobbler/action_litesync.py index 5ce978b2..88bc7d0b 100644 --- a/cobbler/action_litesync.py +++ b/cobbler/action_litesync.py @@ -139,16 +139,6 @@ class BootLiteSync: self.sync.pxegen.write_all_system_files(system) # generate any templates listed in the distro self.sync.pxegen.write_templates(system) - # per system kickstarts - if self.settings.manage_dhcp: - if self.settings.omapi_enabled: - for (name,interface) in system.interfaces.iteritems(): - self.sync.dhcp.write_dhcp_lease( - self.settings.omapi_port, - interface["dns_name"], - interface["mac_address"], - interface["ip_address"] - ) def remove_single_system(self, name): bootloc = utils.tftpboot_location() @@ -156,14 +146,6 @@ class BootLiteSync: # delete contents of kickstarts_sys/$name in webdir system_record = self.systems.find(name=name) - if self.settings.manage_dhcp: - if self.settings.omapi_enabled: - for (name,interface) in system_record.interfaces.iteritems(): - self.sync.dhcp.remove_dhcp_lease( - self.settings.omapi_port, - interface["dns_name"] - ) - itanic = False profile = self.profiles.find(name=system_record.profile) if profile is not None: diff --git a/cobbler/modules/manage_dnsmasq.py b/cobbler/modules/manage_dnsmasq.py index 4a9b47d5..c8f39f13 100644 --- a/cobbler/modules/manage_dnsmasq.py +++ b/cobbler/modules/manage_dnsmasq.py @@ -149,8 +149,6 @@ class DnsmasqManager: # we are now done with the looping through each interface of each system metadata = { - "omapi_enabled" : self.settings.omapi_enabled, - "omapi_port" : self.settings.omapi_port, "insert_cobbler_system_definitions" : system_definitions.get("default",""), "date" : time.asctime(time.gmtime()), "cobbler_server" : self.settings.server, diff --git a/cobbler/modules/manage_isc.py b/cobbler/modules/manage_isc.py index 6369b961..d572cf09 100644 --- a/cobbler/modules/manage_isc.py +++ b/cobbler/modules/manage_isc.py @@ -72,66 +72,6 @@ class IscManager: self.repos = config.repos() self.templar = templar.Templar(config) - def write_dhcp_lease(self,port,host,ip,mac): - """ - Use DHCP's API to create a DHCP entry in the - /var/lib/dhcpd/dhcpd.leases file - #Code from http://svn.osgdc.org/browse/kusu/kusu - # /trunk/src/kits/base/packages/kusu-base-installer/lib/kusu/nodefun.py?r=3025 - # FIXME: should use subprocess - """ - if ip.find("/") != -1: - return - try: - fromchild, tochild = popen2([self.settings.omshell_bin]) - tochild.write("port %s\n" % port) - tochild.flush() - tochild.write("connect\n") - tochild.flush() - tochild.write("new host\n") - tochild.flush() - tochild.write('set name = \"%s\"\n' % host) - tochild.flush() - tochild.write("set ip-address = %s\n" % ip) - tochild.flush() - tochild.write("set hardware-address = %s\n" % mac.lower()) - tochild.flush() - tochild.write("set hardware-type = 1\n") - tochild.flush() - tochild.write("create\n") - tochild.flush() - tochild.close() - fromchild.close() - except IOError: - # FIXME: just catch 32 (broken pipe) and show a warning - pass - - def remove_dhcp_lease(self,port,host): - """ - Use DHCP's API to delete a DHCP entry in - the /var/lib/dhcpd/dhcpd.leases file - """ - fromchild, tochild = popen2([self.settings.omshell_bin]) - try: - tochild.write("port %s\n" % port) - tochild.flush() - tochild.write("connect\n") - tochild.flush() - tochild.write("new host\n") - tochild.flush() - tochild.write('set name = \"%s\"\n' % host) - tochild.flush() - tochild.write("open\n") # opens register with host information - tochild.flush() - tochild.write("remove\n") - tochild.flush() - tochild.close() - fromchild.close() - except IOError: - # FIXME: convert this to subprocess. - # FIXME: catch specific errors only (32/broken pipe) - pass - def write_dhcp_file(self): """ DHCP files are written when manage_dhcp is set in @@ -154,21 +94,6 @@ class IscManager: # is not available counter = 0 - # Clean system definitions in /var/lib/dhcpd/dhcpd.leases just in - # case to avoid conflicts with the hosts we're defining and to clean - # possible removed hosts (only if using OMAPI) - if self.settings.omapi_enabled and self.settings.omapi_port: - if os.path.exists("/var/lib/dhcpd/dhcpd.leases"): - file = open('/var/lib/dhcpd/dhcpd.leases') - item = shlex(file) - while 1: - elem = item.get_token() - if not elem: - break - if elem == 'host': - hostremove = item.get_token() - self.remove_dhcp_lease(self.settings.omapi_port,hostremove) - # we used to just loop through each system, but now we must loop # through each network interface of each system. dhcp_tags = { "default": {} } @@ -243,18 +168,6 @@ class IscManager: elif distro.arch.startswith("ppc"): interface["filename"] = yaboot - # If we have all values defined and we're using omapi, - # we will just create entries dinamically into DHCPD - # without requiring a restart (but file will be written - # as usual for having it working after restart) - - if ip is not None and ip != "": - if mac is not None and mac != "": - if host is not None and host != "": - if self.settings.omapi_enabled and self.settings.omapi_port: - self.remove_dhcp_lease(self.settings.omapi_port,host) - self.write_dhcp_lease(self.settings.omapi_port,host,ip,mac) - dhcp_tag = interface["dhcp_tag"] if dhcp_tag == "": dhcp_tag = "default" @@ -269,8 +182,6 @@ class IscManager: # we are now done with the looping through each interface of each system metadata = { - "omapi_enabled" : self.settings.omapi_enabled, - "omapi_port" : self.settings.omapi_port, "date" : time.asctime(time.gmtime()), "cobbler_server" : self.settings.server, "next_server" : self.settings.next_server, diff --git a/cobbler/modules/sync_post_restart_services.py b/cobbler/modules/sync_post_restart_services.py index 1d7aa80e..f143fc0c 100644 --- a/cobbler/modules/sync_post_restart_services.py +++ b/cobbler/modules/sync_post_restart_services.py @@ -29,8 +29,6 @@ def run(api,args,logger): restart_dns = str(settings.restart_dns).lower() dhcpd_bin = str(settings.dhcpd_bin).lower() dhcpd_init = str(settings.dhcpd_init).lower() - omapi_enabled = str(settings.omapi_enabled).lower() - omapi_port = str(settings.omapi_port).lower() which_dhcp_module = module_loader.get_module_from_file("dhcp","module",just_name=True).strip() which_dns_module = module_loader.get_module_from_file("dns","module",just_name=True).strip() @@ -41,7 +39,7 @@ def run(api,args,logger): rc = 0 if manage_dhcp != "0": if which_dhcp_module == "manage_isc": - if not omapi_enabled in [ "1", "true", "yes", "y" ] and restart_dhcp: + if restart_dhcp: rc = utils.subprocess_call(logger, "%s -t -q" % dhcpd_bin, shell=True) if rc != 0: logger.error("%s -t failed" % dhcpd_bin) diff --git a/cobbler/settings.py b/cobbler/settings.py index 752c8ff6..772cd329 100644 --- a/cobbler/settings.py +++ b/cobbler/settings.py @@ -86,9 +86,6 @@ DEFAULTS = { "mgmt_parameters" : {}, "named_conf" : "/etc/named.conf", "next_server" : "127.0.0.1", - "omapi_enabled" : 0, - "omapi_port" : 647, - "omshell_bin" : "/usr/bin/omshell", "power_management_default_type" : "ipmitool", "power_template_dir" : "/etc/cobbler/power", "pxe_just_once" : 0, diff --git a/installer_templates/settings.template b/installer_templates/settings.template index 2053d7fa..9e017824 100644 --- a/installer_templates/settings.template +++ b/installer_templates/settings.template @@ -206,15 +206,6 @@ named_conf: /etc/named.conf # if you do not set this correctly, this will be manifested in TFTP open timeouts. next_server: $next_server -# if using cobbler with manage_dhcp and ISC, omapi allows realtime DHCP -# updates without restarting ISC dhcpd. However, it may cause -# problems with removing leases and make things less reliable. OMAPI -# usage is experimental and not recommended at this time. - -omapi_enabled: 0 -omapi_port: 647 -omshell_bin: /usr/bin/omshell - # settings for power management features. optional. # see https://fedorahosted.org/cobbler/wiki/PowerManagement to learn more # diff --git a/templates/dhcp.template b/templates/dhcp.template index 66476ad3..a0ef1ad5 100644 --- a/templates/dhcp.template +++ b/templates/dhcp.template @@ -12,9 +12,6 @@ ddns-update-style interim; allow booting; allow bootp; -#if $omapi_enabled -omapi-port $omapi_port; -#end if ignore client-updates; set vendorclass = option vendor-class-identifier; |