Github user rhtyd commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1408#discussion_r61146384 --- Diff: scripts/vm/network/security_group.py --- @@ -36,6 +39,20 @@ hyper = cfo.getEntry("hypervisor.type") if hyper == "lxc": driver = "lxc:///" + +lock_handle = None + +def obtain_file_lock(path): + global lock_handle + lock_handle = open(path, 'w') + try: + fcntl.lockf(lock_handle, fcntl.LOCK_EX | fcntl.LOCK_NB) --- End diff -- - you may consider a `with` open() syntax that is more pythonic - who's closing/expiring these file locks, after the work is done the lock needs to be freed/closed
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---