I have a Python script that does locking thru the file system calls using the Python fcntl module.
The script works fine on an Ubuntu 10.10 release.
But if I run the same script on a Centos 6.2 host, the script bombs with the error:
*AttributeError: 'module' object has no attribute 'F_WRLCK'*
The actual code is:
if Cmd['mode'] == 'r':
lockType = fcntl.F_RDLCK
else:
lockType = fcntl.F_WRLCK
On the Centos host, the script bombs on the last line.
Why doesn't the fcntl module have a F_WRLCK attribute on the Centos 6.2 kernel but does on the Ubuntu?
FYI, both the Ubuntu 10.10 and Centos 6.2 are running Python 2.6.6.
Is there a workaround or solution to this? I need to use fcntl and not flock.