Rename lib/ceph to lib/charms_ceph

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: Id5bdff991c1e6c196c09ba5a2241ebd5ebe6da91
This commit is contained in:
Corey Bryant 2020-02-21 18:46:57 +00:00
parent 0aeffdf356
commit 415b795127
9 changed files with 8 additions and 8 deletions

View File

@ -21,7 +21,7 @@ sys.path.append('lib')
sys.path.append('hooks')
from charmhelpers.core.hookenv import action_get, log, action_fail
from ceph.broker import handle_set_pool_value
from charms_ceph.broker import handle_set_pool_value
if __name__ == '__main__':
name = action_get("name")

View File

@ -18,7 +18,7 @@ import sys
sys.path.append('hooks')
from charmhelpers.core.hookenv import action_set, action_fail
sys.path.append('lib')
from ceph.utils import osd_noout
from charms_ceph.utils import osd_noout
if __name__ == '__main__':
result = osd_noout(True)

View File

@ -18,7 +18,7 @@ import sys
sys.path.append('hooks')
from charmhelpers.core.hookenv import action_set, action_fail
sys.path.append('lib')
from ceph.utils import osd_noout
from charms_ceph.utils import osd_noout
if __name__ == '__main__':
result = osd_noout(False)

View File

@ -22,8 +22,8 @@ import sys
import uuid
sys.path.append('lib')
import ceph.utils as ceph
from ceph.broker import (
import charms_ceph.utils as ceph
from charms_ceph.broker import (
process_requests
)

View File

@ -18,11 +18,11 @@ import os
from tempfile import NamedTemporaryFile
from ceph.utils import (
from charms_ceph.utils import (
get_cephfs,
get_osd_weight
)
from ceph.crush_utils import Crushmap
from charms_ceph.crush_utils import Crushmap
from charmhelpers.core.hookenv import (
log,

View File

@ -20,7 +20,7 @@ from mock import (
patch,
)
from ceph import broker
from charms_ceph import broker
class TestCephOps(unittest.TestCase):