summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/upgradeinstance.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipaserver/install/upgradeinstance.py')
-rw-r--r--ipaserver/install/upgradeinstance.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/ipaserver/install/upgradeinstance.py b/ipaserver/install/upgradeinstance.py
index 66eafa8cc..062d5da22 100644
--- a/ipaserver/install/upgradeinstance.py
+++ b/ipaserver/install/upgradeinstance.py
@@ -78,6 +78,7 @@ 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)
@@ -115,6 +116,22 @@ 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,