summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipaserver/winsync_migrate/base.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/ipaserver/winsync_migrate/base.py b/ipaserver/winsync_migrate/base.py
index 60b75b5eb..60c2cad66 100644
--- a/ipaserver/winsync_migrate/base.py
+++ b/ipaserver/winsync_migrate/base.py
@@ -134,8 +134,12 @@ class MigrateWinsync(admintool.AdminTool):
return entries
- def run(self):
- super(MigrateWinsync, self).run()
+ @classmethod
+ def main(cls, argv):
+ """
+ Sets up API and LDAP connection for the tool, then runs the rest of
+ the plumbing.
+ """
# Finalize API
api.bootstrap(in_server=True, context='server')
@@ -146,7 +150,7 @@ class MigrateWinsync(admintool.AdminTool):
ctx = krbV.default_context()
ccache = ctx.default_ccache()
api.Backend.ldap2.connect(ccache)
- self.ldap = api.Backend.ldap2
+ cls.ldap = api.Backend.ldap2
except krbV.Krb5Error, e:
sys.exit("Must have Kerberos credentials to migrate Winsync users.")
except errors.ACIError, e:
@@ -154,6 +158,11 @@ class MigrateWinsync(admintool.AdminTool):
except errors.DatabaseError, e:
sys.exit("Cannot connect to the LDAP database. Please check if IPA is running.")
+ super(MigrateWinsync, cls).main(argv)
+
+ def run(self):
+ super(MigrateWinsync, self).run()
+
# Create ID overrides replacing the user winsync entries
entries = self.find_winsync_users()
for entry in entries: