ceph-volume: skip osd creation when already done

When rerunning ceph-volume lvm create on a device already prepared and
activated, ceph-volume should skip the creation.

This is a regression introduced by bb4de1a3fc

Fixes: https://tracker.ceph.com/issues/43981

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
This commit is contained in:
Guillaume Abrioux 2020-02-05 17:48:22 +01:00
parent 06c9e64bc6
commit 634a709b9c

View File

@ -239,6 +239,9 @@ class Prepare(object):
"""
if args is not None:
self.args = args
if api.is_ceph_device(self.get_lv(self.args.data)):
logger.info("device {} is already used".format(self.args.data))
raise RuntimeError("skipping {}, it is already prepared".format(self.args.data))
try:
self.prepare()
except Exception: