MCPcopy Create free account
hub / github.com/apache/cloudstack / obtain_file_lock

Function obtain_file_lock

scripts/vm/network/security_group.py:37–47  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

35
36
37def obtain_file_lock(path):
38 global lock_handle
39
40 try:
41 lock_handle = open(path, 'w')
42 fcntl.flock(lock_handle, fcntl.LOCK_EX | fcntl.LOCK_NB)
43 return True
44 except IOError:
45 pass
46
47 return False
48
49
50def execute(cmd):

Callers 1

security_group.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected