From: wanghongxu Date: Fri, 18 Sep 2020 03:28:23 +0000 (+0800) Subject: ceph-volume: add no-systemd argument to zap X-Git-Tag: v16.1.0~918^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37221%2Fhead;p=ceph.git ceph-volume: add no-systemd argument to zap In some container deployment scenarios, systemd services are not used, so the no-systemd parameter is useful. Fixes: https://tracker.ceph.com/issues/47541 Signed-off-by: wanghongxu --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/zap.py b/src/ceph-volume/ceph_volume/devices/lvm/zap.py index 63624e55f5b..21b54b6c0c4 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/zap.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/zap.py @@ -290,7 +290,7 @@ class Zap(object): @decorators.needs_root def zap_osd(self): - if self.args.osd_id: + if self.args.osd_id and not self.args.no_systemd: osd_is_running = systemctl.osd_is_active(self.args.osd_id) if osd_is_running: mlogger.error("OSD ID %s is running, stop it with:" % self.args.osd_id) @@ -384,6 +384,13 @@ class Zap(object): help='Specify an OSD FSID to detect associated devices for zapping', ) + parser.add_argument( + '--no-systemd', + dest='no_systemd', + action='store_true', + help='Skip systemd unit checks', + ) + if len(self.argv) == 0: print(sub_command_help) return