From 6a22c99d4d405de4e9a47de964c4528109fc2157 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Fri, 21 Feb 2020 21:11:49 +0000 Subject: [PATCH] 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/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: I433537805ae56dc7a42e9d34ea6d491ffb4c79c0 --- hooks/hooks.py | 2 +- lib/{ceph => charms_ceph}/__init__.py | 0 lib/{ceph => charms_ceph}/broker.py | 4 ++-- lib/{ceph => charms_ceph}/crush_utils.py | 0 lib/{ceph => charms_ceph}/utils.py | 0 5 files changed, 3 insertions(+), 3 deletions(-) rename lib/{ceph => charms_ceph}/__init__.py (100%) rename lib/{ceph => charms_ceph}/broker.py (99%) rename lib/{ceph => charms_ceph}/crush_utils.py (100%) rename lib/{ceph => charms_ceph}/utils.py (100%) diff --git a/hooks/hooks.py b/hooks/hooks.py index 3d81941c..845714d7 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -23,7 +23,7 @@ import uuid sys.path.append('lib') import ceph_rgw as ceph -import ceph.utils as ceph_utils +import charms_ceph.utils as ceph_utils import multisite from charmhelpers.core.hookenv import ( diff --git a/lib/ceph/__init__.py b/lib/charms_ceph/__init__.py similarity index 100% rename from lib/ceph/__init__.py rename to lib/charms_ceph/__init__.py diff --git a/lib/ceph/broker.py b/lib/charms_ceph/broker.py similarity index 99% rename from lib/ceph/broker.py rename to lib/charms_ceph/broker.py index bae74a12..ceda9a85 100644 --- a/lib/ceph/broker.py +++ b/lib/charms_ceph/broker.py @@ -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, diff --git a/lib/ceph/crush_utils.py b/lib/charms_ceph/crush_utils.py similarity index 100% rename from lib/ceph/crush_utils.py rename to lib/charms_ceph/crush_utils.py diff --git a/lib/ceph/utils.py b/lib/charms_ceph/utils.py similarity index 100% rename from lib/ceph/utils.py rename to lib/charms_ceph/utils.py