From: Andrew Schoen Date: Fri, 24 Aug 2018 19:38:14 +0000 (-0400) Subject: ceph-volume: reset sys_info.devices in the device_info fixture X-Git-Tag: v14.0.1~499^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F23731%2Fhead;p=ceph.git ceph-volume: reset sys_info.devices in the device_info fixture In certain environments it was noticed that when running the full test suite sys_info.devices would get populated correctly from previous tests. This caused the tests to fail because they did not have the expected mock data. Signed-off-by: Andrew Schoen --- diff --git a/src/ceph-volume/ceph_volume/tests/conftest.py b/src/ceph-volume/ceph_volume/tests/conftest.py index bdbe817f16f0..65279dc9bdf7 100644 --- a/src/ceph-volume/ceph_volume/tests/conftest.py +++ b/src/ceph-volume/ceph_volume/tests/conftest.py @@ -155,6 +155,7 @@ def device_info(monkeypatch): devices = devices if devices else {} lsblk = lsblk if lsblk else {} lv = Factory(**lv) if lv else None + monkeypatch.setattr("ceph_volume.sys_info.devices", {}) monkeypatch.setattr("ceph_volume.util.device.disk.get_devices", lambda: devices) monkeypatch.setattr("ceph_volume.util.device.lvm.get_lv_from_argument", lambda path: lv) monkeypatch.setattr("ceph_volume.util.device.disk.lsblk", lambda path: lsblk)