Skip to content

Commit a529b23

Browse files
cephadm: mock a call to shutil.rmtree
Mock out calls to shutil.rmtree in test_deploy_and_rm_iscsi. The test never asserts that things in the file system are removed, so making the call a no-op is safe. Calling shutil.rmtree with the fake file system enabled recently became a problem. In python 3.12 (or 3.11?) changes to the shutil module function shutil.rmtree are incompatible with the fake file system that cephadm tests rely upon heavily. Part of an effort to get ceph tox environments passing on Python 3.12. Signed-off-by: John Mulligan <[email protected]>
1 parent 6739a68 commit a529b23

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cephadm/tests/test_deploy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ def test_deploy_ceph_exporter_container(cephadm_fs, funkypatch):
495495
def test_deploy_and_rm_iscsi(cephadm_fs, funkypatch):
496496
# Test that the deploy and remove paths for iscsi (which has sidecar container)
497497
# create and remove the correct unit files.
498+
funkypatch.patch('shutil.rmtree') # fakefs + shutil.rmtree breaks on py3.12
498499
mocks = _common_patches(funkypatch)
499500
_firewalld = mocks['Firewalld']
500501
fsid = 'b01dbeef-701d-9abe-0000-e1e5a47004a7'

0 commit comments

Comments
 (0)