diff --git a/ipalib/backend.py b/ipalib/backend.py index 89c9a5a67..553dbff29 100644 --- a/ipalib/backend.py +++ b/ipalib/backend.py @@ -63,7 +63,7 @@ class Connectible(Backend): "{0} is already connected ({1} in {2})".format( self.name, self.id, - threading.currentThread().getName() + threading.current_thread().name, ) ) conn = self.create_connection(*args, **kw) @@ -80,7 +80,7 @@ class Connectible(Backend): "{0} is not connected ({1} in {2})".format( self.name, self.id, - threading.currentThread().getName() + threading.current_thread().name, ) ) self.destroy_connection() @@ -105,7 +105,7 @@ class Connectible(Backend): "{0} is not connected ({1} in {2})".format( self.name, self.id, - threading.currentThread().getName() + threading.current_thread().name, ) ) return getattr(context, self.id).conn diff --git a/ipatests/test_ipalib/test_backend.py b/ipatests/test_ipalib/test_backend.py index b587029e3..e43830abb 100644 --- a/ipatests/test_ipalib/test_backend.py +++ b/ipatests/test_ipalib/test_backend.py @@ -94,7 +94,8 @@ class test_Connectible(ClassChecker): m = "{0} is already connected ({1} in {2})" e = raises(Exception, o.connect, *args, **kw) assert str(e) == m.format( - 'example', o.id, threading.currentThread().getName()) + "example", o.id, threading.current_thread().name + ) # Double check that it works after deleting context.example: del context.example @@ -124,7 +125,8 @@ class test_Connectible(ClassChecker): m = "{0} is not connected ({1} in {2})" e = raises(Exception, o.disconnect) assert str(e) == m.format( - 'example', o.id, threading.currentThread().getName()) + "example", o.id, threading.current_thread().name + ) context.example = 'The connection.' assert o.disconnect() is None @@ -169,7 +171,7 @@ class test_Connectible(ClassChecker): o = klass(api, shared_instance=True) e = raises(AttributeError, getattr, o, 'conn') assert str(e) == msg.format( - klass.__name__, o.id, threading.currentThread().getName() + klass.__name__, o.id, threading.current_thread().name ) conn = Connection('The connection.', Disconnect()) setattr(context, klass.__name__, conn)