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: If8243cc62c3dd9cd5f5b0d664981975efc6300cc Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
a106f25e8e
commit
023be4f561
@ -19,6 +19,7 @@ from nova.api.openstack import wsgi_app
|
||||
NAME = "metadata"
|
||||
|
||||
application = None
|
||||
with threading.Lock():
|
||||
lock = threading.Lock()
|
||||
with lock:
|
||||
if application is None:
|
||||
application = wsgi_app.init_application(NAME)
|
||||
|
@ -19,6 +19,7 @@ from nova.api.openstack import wsgi_app
|
||||
NAME = "osapi_compute"
|
||||
|
||||
application = None
|
||||
with threading.Lock():
|
||||
lock = threading.Lock()
|
||||
with lock:
|
||||
if application is None:
|
||||
application = wsgi_app.init_application(NAME)
|
||||
|
Loading…
x
Reference in New Issue
Block a user