fcfa499f11
The new python3-ceph-common deb package (introduced in ceph octopus) adds a new ceph directory (a parent package in python terms) in /usr/lib/python3/dist-packages/ceph/. This results in a conflict with charm-ceph-osd/lib/ceph/. For example, with the current import of ceph.utils in hooks/ceph_hooks.py, Python finds no utils.py in /usr/lib/python3/dist-packages/ceph/ and then stops searching. Therefore, rename lib/ceph to lib/charms_ceph to avoid the conflict. Depends-On: https://review.opendev.org/#/c/709226 Change-Id: I13ae7c048d8f1eef2ea64b13ae14b51dbfaaf3cd
28 lines
1.0 KiB
Python
28 lines
1.0 KiB
Python
from actions import list_disks
|
|
|
|
from test_utils import CharmTestCase
|
|
|
|
|
|
class ListDisksActionTests(CharmTestCase):
|
|
def setUp(self):
|
|
super(ListDisksActionTests, self).setUp(
|
|
list_disks, ['hookenv',
|
|
'charms_ceph',
|
|
'utils',
|
|
'os'])
|
|
self.charms_ceph.utils.unmounted_disks.return_value = ['/dev/sda',
|
|
'/dev/sdm']
|
|
|
|
def test_list_disks_journal_symbol_link(self):
|
|
self.utils.get_journal_devices.return_value = {'/dev/disk/ceph/sdm'}
|
|
self.os.path.realpath.return_value = '/dev/sdm'
|
|
self.charms_ceph.utils.is_active_bluestore_device.return_value = False
|
|
self.charms_ceph.utils.is_pristine_disk.return_value = False
|
|
self.utils.get_blacklist.return_value = []
|
|
list_disks.list_disk()
|
|
self.hookenv.action_set.assert_called_with({
|
|
'disks': ['/dev/sda'],
|
|
'blacklist': [],
|
|
'non-pristine': ['/dev/sda']
|
|
})
|