Server Upgrade: Remove unused PRE_SCHEMA_UPDATE

This is not used anymore.

Ticket: https://fedorahosted.org/freeipa/ticket/4904
Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Martin Basti authored and Tomas Babej committed 2015-03-19 12:33:22 +01:00
1 parent d0d79ada37
commit d3f5d5d1ff
6 files changed
+10 -56

No files matched your search

+7 -9
View File
@@ -191,15 +191,6 @@ class LDAPUpdater_NonUpgrade(LDAPUpdater):
modified = False
ld = LDAPUpdate(
dm_password=self.dirman_password,
sub_dict={},
live_run=not options.test,
ldapi=options.ldapi,
plugins=options.plugins or self.run_plugins)
modified = ld.pre_schema_update(ordered=True)
if options.update_schema:
modified = schemaupdate.update_schema(
options.schema_files,
@@ -207,6 +198,13 @@ class LDAPUpdater_NonUpgrade(LDAPUpdater):
live_run=not options.test,
ldapi=options.ldapi) or modified
ld = LDAPUpdate(
dm_password=self.dirman_password,
sub_dict={},
live_run=not options.test,
ldapi=options.ldapi,
plugins=options.plugins or self.run_plugins)
if not self.files:
self.files = ld.get_all_files(UPDATES_DIR)
+1 -14
View File
@@ -42,8 +42,7 @@ from ipalib import api
from ipaplatform.paths import paths
from ipapython.dn import DN
from ipapython.ipa_log_manager import *
from ipaserver.install.plugins import (PRE_UPDATE, POST_UPDATE,
PRE_SCHEMA_UPDATE)
from ipaserver.install.plugins import (PRE_UPDATE, POST_UPDATE)
from ipaserver.plugins import ldap2
UPDATES_DIR=paths.UPDATES_DIR
@@ -803,18 +802,6 @@ class LDAPUpdate:
for dn, update in sorted_updates:
self._delete_record(update)
def pre_schema_update(self, ordered=False):
"""Execute the update before the LDPA schema is updated.
"""
if self.plugins:
self.info('PRE_SCHEMA_UPDATE')
all_updates = {}
updates = api.Backend.updateclient.update(PRE_SCHEMA_UPDATE, self.dm_password, self.ldapi, self.live_run)
self.merge_updates(all_updates, updates)
self._run_updates(all_updates)
return self.modified
def update(self, files, ordered=False):
"""Execute the update. files is a list of the update files to use.
-1
View File
@@ -20,7 +20,6 @@
"""
Provide a separate api for updates.
"""
PRE_SCHEMA_UPDATE = 0
PRE_UPDATE = 1
POST_UPDATE = 2
+1 -13
View File
@@ -20,8 +20,7 @@
from ipalib import api
from ipalib import Updater, Object
from ipaserver.install import service
from ipaserver.install.plugins import (PRE_UPDATE, POST_UPDATE,
PRE_SCHEMA_UPDATE, MIDDLE)
from ipaserver.install.plugins import (PRE_UPDATE, POST_UPDATE, MIDDLE)
class DSRestart(service.Service):
"""
@@ -57,17 +56,6 @@ class update(Object):
api.register(update)
class PreSchemaUpdate(Updater):
"""
Base class for updates that run after file processing.
"""
updatetype = PRE_SCHEMA_UPDATE
order = MIDDLE
def __init__(self):
super(PreSchemaUpdate, self).__init__()
class PreUpdate(Updater):
"""
Base class for updates that run prior to file processing.
+1 -2
View File
@@ -25,8 +25,7 @@ import time
from ldif import LDIFWriter
from ipaserver.install.plugins import MIDDLE, LAST
from ipaserver.install.plugins.baseupdate import (PostUpdate, PreUpdate,
PreSchemaUpdate)
from ipaserver.install.plugins.baseupdate import (PostUpdate, PreUpdate)
from ipaserver.install import sysupgrade
from ipalib import api, errors, util
from ipapython.dn import DN
-17
View File
@@ -77,7 +77,6 @@ class IPAUpgrade(service.Service):
self.step("saving configuration", self.__save_config)
self.step("disabling listeners", self.__disable_listeners)
self.step("starting directory server", self.__start_nowait)
self.step("preparing server upgrade", self.__pre_schema_upgrade)
if self.schema_files:
self.step("updating schema", self.__update_schema)
self.step("upgrading server", self.__upgrade)
@@ -122,22 +121,6 @@ class IPAUpgrade(service.Service):
installutils.set_directive(self.filename, 'nsslapd-ldapientrysearchbase',
None, quotes=False, separator=':')
def __pre_schema_upgrade(self):
try:
ld = ldapupdate.LDAPUpdate(dm_password='', ldapi=True, live_run=self.live_run, plugins=True)
self.modified = (ld.pre_schema_update(ordered=True) or
self.modified)
except ldapupdate.BadSyntax, e:
root_logger.error('Bad syntax in pre schema upgrade %s' % str(e))
self.modified = False
self.badsyntax = True
except Exception, e:
# Bad things happened, return gracefully
self.modified = False
self.upgradefailed = True
root_logger.error('Pre schema upgrade failed with %s' % str(e))
root_logger.debug('%s', traceback.format_exc())
def __update_schema(self):
self.modified = schemaupdate.update_schema(
self.schema_files,