wsgi: Don't create, use lock in same line
As noted on the mailing list some time back [1], pylint flags this as a useless lock [2]. Make it non-useless. [1] https://lists.openstack.org/archives/list/openstack-discuss@lists.openstack.org/message/CZVC6SEMUSEH7UT5LDHOWL7WBZ2OXUWZ/ [2] https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/useless-with-lock.html Change-Id: Ia0d3899d84db5fce92fad17d19f375681debe864 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
1 parent
ee437c72ca
commit
037bf7c4d5
1 file changed
+2
-1
@@ -17,6 +17,7 @@ import threading
|
||||
from keystone.server import wsgi
|
||||
|
||||
application = None
|
||||
with threading.Lock():
|
||||
lock = threading.Lock()
|
||||
with lock:
|
||||
if application is None:
|
||||
application = wsgi.initialize_public_application()
|
||||
Reference in new issue
Block a user