Patch attached.
From d0aa4c4ea64f9351bcbead3e9f4412ed1f33a966 Mon Sep 17 00:00:00 2001 From: Martin Basti <mba...@redhat.com> Date: Wed, 6 Apr 2016 16:48:49 +0200 Subject: [PATCH] Remove unused variable and finally block in SchemaCache
Handling exceptions in python is expensive operation, removing of uneeded finally block is good for performance. --- ipapython/ipaldap.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py index 405f1ee2f2ffb3622da30592db67c5aa981748c2..7e920e1003d84b729547d75d8e1324d2f73c120c 100644 --- a/ipapython/ipaldap.py +++ b/ipapython/ipaldap.py @@ -21,7 +21,6 @@ import time import datetime -import shutil from decimal import Decimal from copy import deepcopy import contextlib @@ -155,7 +154,6 @@ class SchemaCache(object): If a connection is provided then it the credentials bound to it are used. The connection is not closed when the request is done. """ - tmpdir = None assert conn is not None self.log.debug( @@ -184,9 +182,6 @@ class SchemaCache(object): # TODO: DS uses 'cn=schema', support for other server? # raise a more appropriate exception raise - finally: - if tmpdir: - shutil.rmtree(tmpdir) return ldap.schema.SubSchema(schema_entry[1]) -- 2.5.5
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code