]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: fix running test suite on python3.6 48557/head
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 12 Oct 2022 18:06:40 +0000 (14:06 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 25 Oct 2022 14:02:57 +0000 (10:02 -0400)
While a new version of pyfakefs is available, version 5 is not available
for python 3.6. In order to run the test suite on centos 8 we will
continue to work with pyfakefs version 4.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/tests/fixtures.py
src/cephadm/tox.ini

index d0f068876c84c2f10568fe50e8d4b6e9cf820af8..b3926f9a9de840d901a99764abb3dd4ab3b04711 100644 (file)
@@ -77,8 +77,11 @@ def cephadm_fs(
          mock.patch('platform.processor', return_value='x86_64'), \
          mock.patch('cephadm.extract_uid_gid', return_value=(uid, gid)):
 
-        if not fake_filesystem.is_root():
-            fake_filesystem.set_uid(0)
+        try:
+            if not fake_filesystem.is_root():
+                fake_filesystem.set_uid(0)
+        except AttributeError:
+            pass
 
         fs.create_dir(_cephadm.DATA_DIR)
         fs.create_dir(_cephadm.LOG_DIR)
index b2a3bf0b924d115d96bbf462810d73155c945ecd..80449320ee9c3c3934a44ffca32fbe8b8fd02eff 100644 (file)
@@ -34,7 +34,8 @@ addopts =
 [testenv]
 skip_install=true
 deps =
-  pyfakefs == 5.0
+  pyfakefs == 4.5.6 ; python_version < "3.7"
+  pyfakefs >= 5, < 6 ; python_version >= "3.7"
   mock
   pytest
 commands=pytest {posargs}