mirror of https://github.com/ceph/ceph-ansible.git
ceph_volume: fix unit tests
Fix the container_binary to use by mocking the CEPH_CONTAINER_BINARY env variable. Signed-off-by: Sébastien Han <seb@redhat.com>pull/3375/head
parent
3d0670b41c
commit
a42ba03d71
|
@ -273,7 +273,7 @@ def batch(module, container_image):
|
|||
journal_size = module.params.get('journal_size', None)
|
||||
block_db_size = module.params.get('block_db_size', None)
|
||||
dmcrypt = module.params.get('dmcrypt', None)
|
||||
osds_per_device = module.params.get('osds_per_device', None)
|
||||
osds_per_device = module.params.get('osds_per_device', 1)
|
||||
|
||||
if not osds_per_device:
|
||||
fatal('osds_per_device must be provided if action is "batch"', module)
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
from . import ceph_volume
|
||||
from ansible.compat.tests.mock import MagicMock
|
||||
import mock
|
||||
import os
|
||||
|
||||
|
||||
@mock.patch.dict(os.environ, {'CEPH_CONTAINER_BINARY': 'docker'})
|
||||
class TestCephVolumeModule(object):
|
||||
|
||||
def test_data_no_vg(self):
|
||||
|
|
Loading…
Reference in New Issue