Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
From: Su Yue <glass.su@suse.com>
To: drbd-dev@lists.linbit.com
Cc: lars.ellenberg@linbit.com
Subject: [RFC PATCH 2/3] drbd.ocf: update regex of sed for new output from crm_resource
Date: Mon, 29 Jul 2024 21:34:09 +0800	[thread overview]
Message-ID: <20240729133410.8332-3-glass.su@suse.com> (raw)
In-Reply-To: <20240729133410.8332-1-glass.su@suse.com>

Since Pacemaker-2.1.0
crm_resource --resource "$OCF_RESOURCE_INSTANCE" --locate outputs
'resource promotable-clone is running on: cluster02 Promoted'
was
'resource promotable-clone is running on: cluster02 Master'.

So update the regular expression.

Signed-off-by: Su Yue <glass.su@suse.com>
---
 scripts/drbd.ocf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf
index 133aff737455..bbe25f38edda 100755
--- a/scripts/drbd.ocf
+++ b/scripts/drbd.ocf
@@ -999,7 +999,7 @@ crm_resource_locate_master()
 	called_crm_resource_locate=true
 	DRBD_PRIMARY_PEER_according_to_pcmk=$(
 		crm_resource --resource "$OCF_RESOURCE_INSTANCE" --locate 2>/dev/null |
-		sed -ne 's/^.*is running on: \([^ ]*\) Master.*$/\1/p' |
+		sed -ne 's/^.*is running on: \([^ ]*\) \(Master\|Promoted\).*$/\1/p' |
 		grep -vix -m1 -e "$HOSTNAME")
 }
 
-- 
2.45.2


  parent reply	other threads:[~2024-07-29 13:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 13:34 [RFC PATCH 0/3] drbd.ocf support for OCF 1.1 standard Su Yue
2024-07-29 13:34 ` [RFC PATCH 1/3] drbd.ocf: replace crm_master with ocf_promotion_score Su Yue
2024-07-29 13:34 ` Su Yue [this message]
2024-07-29 13:34 ` [RFC PATCH 3/3] drbd.ocf: update for OCF 1.1 Su Yue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240729133410.8332-3-glass.su@suse.com \
    --to=glass.su@suse.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=lars.ellenberg@linbit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox