]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: import types from the modules that defines them
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 28 Sep 2023 21:00:47 +0000 (17:00 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 18 Oct 2023 19:51:23 +0000 (15:51 -0400)
For the test fixtures created for Podman and Docker, import the Podman
and Docker types from the module that defines them, rather than the
cephadm.py file which now imports them.

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

index ebed7b3d21ca76740b897eb15ee7a21a8413741c..788913ae6b8ed02fd4deb298e0a81224711b39a4 100644 (file)
@@ -17,15 +17,17 @@ def import_cephadm():
 
 
 def mock_docker():
-    _cephadm = import_cephadm()
-    docker = mock.Mock(_cephadm.Docker)
+    from cephadmlib.container_engines import Docker
+
+    docker = mock.Mock(Docker)
     docker.path = '/usr/bin/docker'
     return docker
 
 
 def mock_podman():
-    _cephadm = import_cephadm()
-    podman = mock.Mock(_cephadm.Podman)
+    from cephadmlib.container_engines import Podman
+
+    podman = mock.Mock(Podman)
     podman.path = '/usr/bin/podman'
     podman.version = (2, 1, 0)
     return podman