From 56b203b8caf8f0179ed21292558826bc7098d86c Mon Sep 17 00:00:00 2001 From: Erwan MAS Date: Mon, 22 Jun 2020 19:21:55 +0000 Subject: [PATCH] we need to extract the number by take taking the last number from the right . current implementation does not work when the cluster name has a - --- utils/usr/bin/oci-make-osd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/usr/bin/oci-make-osd b/utils/usr/bin/oci-make-osd index 765b2c0c..2155a74b 100755 --- a/utils/usr/bin/oci-make-osd +++ b/utils/usr/bin/oci-make-osd @@ -26,7 +26,7 @@ chown ceph /etc/ceph/ceph.client.admin.keyring # - drive letter # - OSD id # - OSD port number -MAJOR_NUM=$(hostname -s | cut -d- -f3) +MAJOR_NUM=$(hostname -s | sed 's/^.*\-\([0-9]*\)$/\1/p;d' ) if echo ${HDD_DEV} | grep -q nvme ; then NVME_DRIVE_NUM=$(echo ${HDD_DEV} | sed sed -e s/nvme// -e s/n1//) # We add 1 to avoid issue when nvme0n1 -- GitLab