diff options
author | Petr Viktorin <pviktori@redhat.com> | 2013-01-21 07:23:20 -0500 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2013-03-01 16:59:45 +0100 |
commit | 5271eb217c4227a83ac99f9c8daa7e853871523a (patch) | |
tree | df833ba7f8a740b2675433a76cf59720c963fb9e /ipaserver/ipaldap.py | |
parent | b69f6983e4bb01e2af63c4b02a0ab79b24e59569 (diff) | |
download | freeipa.git-5271eb217c4227a83ac99f9c8daa7e853871523a.tar.gz freeipa.git-5271eb217c4227a83ac99f9c8daa7e853871523a.tar.xz freeipa.git-5271eb217c4227a83ac99f9c8daa7e853871523a.zip |
Replace IPAdmin.checkTask by replication.wait_for_task
The method was only used for waiting, not actual checking.
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
Diffstat (limited to 'ipaserver/ipaldap.py')
-rw-r--r-- | ipaserver/ipaldap.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py index 7253bc1f..54498250 100644 --- a/ipaserver/ipaldap.py +++ b/ipaserver/ipaldap.py @@ -1770,30 +1770,6 @@ class IPAdmin(LDAPConnection): return entry - def checkTask(self, dn, dowait=False, verbose=False): - """check task status - task is complete when the nsTaskExitCode attr - is set return a 2 tuple (true/false,code) first is false if task is - running, true if done - if true, second is the exit code - if dowait - is True, this function will block until the task is complete - """ - assert isinstance(dn, DN) - attrlist = ['nsTaskLog', 'nsTaskStatus', 'nsTaskExitCode', 'nsTaskCurrentItem', 'nsTaskTotalItems'] - done = False - exitCode = 0 - while not done: - try: - entry = self.getEntry(dn, ldap.SCOPE_BASE, "(objectclass=*)", attrlist) - except errors.NotFound: - break - if verbose: - print entry - if entry.getValue('nsTaskExitCode'): - exitCode = int(entry.getValue('nsTaskExitCode')) - done = True - if dowait: time.sleep(1) - else: break - return (done, exitCode) - def __getattr__(self, attrname): # This makes IPAdmin classes look like IPASimpleLDAPObjects # FIXME: for backwards compatibility only |