From 52306f841910825ed632307415f31155f0b0c4a6 Mon Sep 17 00:00:00 2001 From: Frode Nordahl <frode.nordahl@gmail.com> Date: Mon, 23 Oct 2017 09:20:54 +0200 Subject: [PATCH] Fix imports for actions Commit 4bcdddc4a36e5ac7ddfd97d491183995f6ca2221 code cleanup did not address actions. Fixed. Change-Id: Ic5de38e4d56022e3f72e5dcb08f6a4253e3306ee Closes-bug: #1726275 --- actions/add_disk.py | 17 ++++++++++------- actions/list_disks.py | 2 +- actions/replace_osd.py | 14 ++++++++------ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/actions/add_disk.py b/actions/add_disk.py index 9e30349..123fa7f 100755 --- a/actions/add_disk.py +++ b/actions/add_disk.py @@ -31,7 +31,10 @@ from charmhelpers.contrib.storage.linux.ceph import ( send_request_if_needed, ) -import ceph +from ceph.utils import ( + osdize, + tune_dev, +) from ceph_hooks import ( get_journal_devices, @@ -39,14 +42,14 @@ from ceph_hooks import ( def add_device(request, device_path, bucket=None): - ceph.osdize(dev, config('osd-format'), - get_journal_devices(), config('osd-reformat'), - config('ignore-device-errors'), - config('osd-encrypt'), - config('bluestore')) + osdize(dev, config('osd-format'), + get_journal_devices(), config('osd-reformat'), + config('ignore-device-errors'), + config('osd-encrypt'), + config('bluestore')) # Make it fast! if config('autotune'): - ceph.tune_dev(dev) + tune_dev(dev) mounts = filter(lambda disk: device_path in disk.device, psutil.disk_partitions()) if mounts: diff --git a/actions/list_disks.py b/actions/list_disks.py index f92a3b6..7bf971f 100755 --- a/actions/list_disks.py +++ b/actions/list_disks.py @@ -28,7 +28,7 @@ sys.path.append('lib/') from charmhelpers.core.hookenv import action_set -from ceph import unmounted_disks +from ceph.utils import unmounted_disks if __name__ == '__main__': action_set({ diff --git a/actions/replace_osd.py b/actions/replace_osd.py index edfa1f7..b23a10d 100755 --- a/actions/replace_osd.py +++ b/actions/replace_osd.py @@ -22,7 +22,9 @@ sys.path.append('lib/') from charmhelpers.core.hookenv import action_get, log, config, action_fail -import ceph +from ceph.utils import ( + replace_osd, +) """ Given a OSD number this script will attempt to turn that back into a mount @@ -90,8 +92,8 @@ if __name__ == '__main__': osd_format = config('osd-format') osd_journal = config('osd-journal') - ceph.replace_osd(dead_osd_number=dead_osd_number, - dead_osd_device="/dev/{}".format(device_name), - new_osd_device=replacement_device, - osd_format=osd_format, - osd_journal=osd_journal) + replace_osd(dead_osd_number=dead_osd_number, + dead_osd_device="/dev/{}".format(device_name), + new_osd_device=replacement_device, + osd_format=osd_format, + osd_journal=osd_journal) -- GitLab