If two or more crm commands executed in parallel one of them may fail:
Traceback (most recent call last):
File "/usr/sbin/crm", line 61, in <module>
rc = main.run()
File "/usr/lib/python2.7/site-packages/crmsh/main.py", line 352, in run
userdir.mv_user_files()
File "/usr/lib/python2.7/site-packages/crmsh/userdir.py", line 60, in mv_user_files
HISTORY_FILE = _xdg_file(HISTORY_FILE, "history", os.path.isfile, CACHE_HOME)
File "/usr/lib/python2.7/site-packages/crmsh/userdir.py", line 47, in _xdg_file
os.makedirs(directory, 0o700)
File "/usr/lib64/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: '/root/.cache/crm'
If two or more
crm
commands executed in parallel one of them may fail:Probably it's because of a time gap between
isdir
andmakedirs
: https://github.com/ClusterLabs/crmsh/blob/d0150a8874d800caf7abb57c8f17e1a73f9dd0a6/crmsh/userdir.py#L50-L51