diff options
author | Martin Basti <mbasti@redhat.com> | 2015-03-18 15:46:00 +0100 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2015-04-14 19:25:47 +0200 |
commit | f24f614396de809350b54423ca128b478601a64e (patch) | |
tree | 7284b80ce5c44ef57f507092e7be312ea082aa61 /ipaserver/install/plugins/update_passsync.py | |
parent | cc19b5a76a37d1fb87deb45d9cbfc71472a99fa4 (diff) | |
download | freeipa-f24f614396de809350b54423ca128b478601a64e.tar.gz freeipa-f24f614396de809350b54423ca128b478601a64e.tar.xz freeipa-f24f614396de809350b54423ca128b478601a64e.zip |
Server Upgrade: specify order of plugins in update files
* add 'plugin' directive
* specify plugins order in update files
* remove 'run plugins' options
* use ldapupdater API instance in plugins
* add update files representing former PreUpdate and PostUpdate order of plugins
https://fedorahosted.org/freeipa/ticket/4904
Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver/install/plugins/update_passsync.py')
-rw-r--r-- | ipaserver/install/plugins/update_passsync.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/ipaserver/install/plugins/update_passsync.py b/ipaserver/install/plugins/update_passsync.py index 61c3a77c5..1bda790fc 100644 --- a/ipaserver/install/plugins/update_passsync.py +++ b/ipaserver/install/plugins/update_passsync.py @@ -2,15 +2,13 @@ # Copyright (C) 2014 FreeIPA Contributors see COPYING for license # -from ipaserver.install.plugins import MIDDLE, LAST -from ipaserver.install.plugins.baseupdate import PreUpdate, PostUpdate from ipalib import api, errors +from ipalib import Updater from ipapython.dn import DN from ipapython.ipa_log_manager import root_logger from ipaserver.install import sysupgrade -class update_passync_privilege_check(PreUpdate): - order = MIDDLE +class update_passync_privilege_check(Updater): def execute(self, **options): update_done = sysupgrade.get_upgrade_state('winsync', 'passsync_privilege_updated') @@ -24,7 +22,7 @@ class update_passync_privilege_check(PreUpdate): self.api.env.container_privilege, self.api.env.basedn) - ldap = self.obj.backend + ldap = self.api.Backend.ldap2 try: ldap.get_entry(passsync_privilege_dn, ['']) except errors.NotFound: @@ -38,13 +36,11 @@ class update_passync_privilege_check(PreUpdate): api.register(update_passync_privilege_check) -class update_passync_privilege_update(PostUpdate): +class update_passync_privilege_update(Updater): """ Add PassSync user as a member of PassSync privilege, if it exists """ - order = LAST - def execute(self, **options): update_done = sysupgrade.get_upgrade_state('winsync', 'passsync_privilege_updated') if update_done: @@ -52,7 +48,7 @@ class update_passync_privilege_update(PostUpdate): return False, [] root_logger.debug("Add PassSync user as a member of PassSync privilege") - ldap = self.obj.backend + ldap = self.api.Backend.ldap2 passsync_dn = DN(('uid','passsync'), ('cn', 'sysaccounts'), ('cn', 'etc'), api.env.basedn) passsync_privilege_dn = DN(('cn','PassSync Service'), |