When launching "tox" (tox -e py27 actually) locally, I get many "OSError: [Errno 18] Invalid cross-device link
" error messages.
FAIL: keystoneclient.tests.test_auth_token_middleware.CrossVersionAuthTokenMiddlewareTest.test_valid_uuid_request_forced_to_2_0
tags: worker-1
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/florent/src/python-keystoneclient/.tox/py27/local/lib/python2.7/site-packages/httpretty/core.py", line 1006, in wrapper
return test(*args, **kw)
File "keystoneclient/tests/test_auth_token_middleware.py", line 1158, in test_valid_uuid_request_forced_to_2_0
self.set_middleware(conf=conf)
File "keystoneclient/tests/test_auth_token_middleware.py", line 274, in set_middleware
{"revoked": [], "extra": "success"})
File "keystoneclient/middleware/auth_token.py", line 1251, in token_revocation_list
os.rename(f.name, self.revoked_file_name)
OSError: [Errno 18] Invalid cross-device link
This happen when os.rename(fname_old, fname_new) is called and fname_old are on different partitions. In that case os.rename raises an exception instead of moving the file.
To deal with that issue, we can use shutil.move instead of os.rename as documented there:
As documented there https://mail.python.org/pipermail/python-list/2005-February/342893.html
Fix proposed to branch: master /review. openstack. org/64544
Review: https:/