From e2ff994ba2ba31ef9409695ea133576480adc759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hoo=20Sooyean=20=E4=BD=95=E6=9B=B8=E6=B7=B5?= Date: Thu, 1 Jun 2023 17:20:26 +0800 Subject: [PATCH] =?UTF-8?q?Add=20a=20regex=20to=20allow=20Server=20with=20?= =?UTF-8?q?"Master=20:"=20in=20Infra=20Status=20also=20get=20recognised=20?= =?UTF-8?q?as=20a=20Puppet=20Primary=20host.=20E.g.=20in=20PE=202021.3.0?= =?UTF-8?q?=20Signed-off-by:=20Hoo=20Sooyean=20(=E4=BD=95=E6=9B=B8?= =?UTF-8?q?=E6=B7=B5)=20<60423341+sooyean-hoo@users.noreply.github.com>=20?= =?UTF-8?q?Signed-off-by:=20Hoo=20Sooyean=20=E4=BD=95=E6=9B=B8=E6=B7=B5=20?= =?UTF-8?q??= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/confirm_primary_server.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/confirm_primary_server.rb b/tasks/confirm_primary_server.rb index 3107c63..5b0a90d 100755 --- a/tasks/confirm_primary_server.rb +++ b/tasks/confirm_primary_server.rb @@ -15,8 +15,8 @@ def get_primary_hostname(ignore_infra_status_error) end end output.each_line do |line| - if line.match(/^Primary: /) - primary = line.gsub(/^Primary: /, '').lstrip.rstrip + if line.match(/^Primary: |^Master: /) + primary = line.gsub(/^Primary: |^Master: /, '').lstrip.rstrip return primary end end