-
Notifications
You must be signed in to change notification settings - Fork 95
Fix Syntax Warning when running adminCLI command. #1181
Conversation
Test manually.
|
esx_service/utils/vmdk_utils.py
Outdated
logging.debug("init_datastoreCache: %s", datastores) | ||
|
||
with lockManager.get_lock("init_datastoreCache"): | ||
global datastores | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as @govint has pointed out, we need to have references of datastores under the lock.
Need to move line 76 and 77 under with... statement.
@pshahzeb I have addressed your comments. Please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -73,10 +73,9 @@ def init_datastoreCache(force=False): | |||
from local ESX host. force=True will force it to ignore current cache | |||
and force init | |||
""" | |||
logging.debug("init_datastoreCache: %s", datastores) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'd suggest to add logs before and after acquiring locks so that it's easier to debug potential dead lock issues.
Fixed #1180