charm-ceph-mon/actions/unset_noout.py
Corey Bryant 415b795127 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
2020-02-24 15:07:44 +00:00

29 lines
963 B
Python
Executable File

#!/usr/bin/env python3
#
# Copyright 2017 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
sys.path.append('hooks')
from charmhelpers.core.hookenv import action_set, action_fail
sys.path.append('lib')
from charms_ceph.utils import osd_noout
if __name__ == '__main__':
result = osd_noout(False)
if result:
action_set({'message': 'Ceph osd noout has been unset'})
else:
action_fail('Ceph osd noout failed to unset')