Auto sync2gitlab import of resource-agents-4.9.0-27.el8.src.rpm

This commit is contained in:
CentOS Sources 2022-07-22 06:11:05 +00:00
parent f8eccfded0
commit 03ce8ac0be
7 changed files with 666 additions and 10 deletions

View File

@ -0,0 +1,55 @@
From bb5cfa172ca58cd8adcedcaca92bde54d0645661 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Thu, 14 Jul 2022 10:55:19 +0200
Subject: [PATCH] openstack-agents: set domain parameter's default to Default
and fix missing parameter name in ocf_exit_reason
---
heartbeat/openstack-common.sh | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/heartbeat/openstack-common.sh b/heartbeat/openstack-common.sh
index b6eec09c..14d290bd 100644
--- a/heartbeat/openstack-common.sh
+++ b/heartbeat/openstack-common.sh
@@ -1,6 +1,10 @@
+OCF_RESKEY_user_domain_name_default="Default"
+OCF_RESKEY_project_domain_name_default="Default"
OCF_RESKEY_openstackcli_default="/usr/bin/openstack"
OCF_RESKEY_insecure_default="false"
+: ${OCF_RESKEY_user_domain_name=${OCF_RESKEY_user_domain_name_default}}
+: ${OCF_RESKEY_project_domain_name=${OCF_RESKEY_project_domain_name_default}}
: ${OCF_RESKEY_openstackcli=${OCF_RESKEY_openstackcli_default}}
: ${OCF_RESKEY_insecure=${OCF_RESKEY_insecure_default}}
@@ -64,7 +68,7 @@ Keystone Project.
Keystone User Domain Name.
</longdesc>
<shortdesc lang="en">Keystone User Domain Name</shortdesc>
-<content type="string" />
+<content type="string" default="${OCF_RESKEY_user_domain_name_default}" />
</parameter>
<parameter name="project_domain_name" required="0">
@@ -72,7 +76,7 @@ Keystone User Domain Name.
Keystone Project Domain Name.
</longdesc>
<shortdesc lang="en">Keystone Project Domain Name</shortdesc>
-<content type="string" />
+<content type="string" default="${OCF_RESKEY_project_domain_name_default}" />
</parameter>
<parameter name="openstackcli">
@@ -133,7 +137,7 @@ get_config() {
exit $OCF_ERR_CONFIGURED
fi
if [ -z "$OCF_RESKEY_project_domain_name" ]; then
- ocf_exit_reason " not set"
+ ocf_exit_reason "project_domain_name not set"
exit $OCF_ERR_CONFIGURED
fi
--
2.36.1

View File

@ -0,0 +1,282 @@
From ebea4c3620261c529cad908c0e52064df84b0c61 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Mon, 11 Jul 2022 10:28:11 +0200
Subject: [PATCH] openstack-agents: warn when openstackcli is slow
---
heartbeat/openstack-cinder-volume | 19 +++++++++++--------
heartbeat/openstack-common.sh | 22 ++++++++++++++++++++++
heartbeat/openstack-floating-ip | 17 ++++++++++-------
heartbeat/openstack-info.in | 20 ++++++++++----------
heartbeat/openstack-virtual-ip | 20 ++++++++++----------
5 files changed, 63 insertions(+), 35 deletions(-)
diff --git a/heartbeat/openstack-cinder-volume b/heartbeat/openstack-cinder-volume
index 19bf04faf..116442c41 100755
--- a/heartbeat/openstack-cinder-volume
+++ b/heartbeat/openstack-cinder-volume
@@ -113,11 +113,14 @@ _get_node_id() {
}
osvol_validate() {
+ local result
+
check_binary "$OCF_RESKEY_openstackcli"
get_config
- if ! $OCF_RESKEY_openstackcli volume list|grep -q $OCF_RESKEY_volume_id ; then
+ result=$(run_openstackcli "volume list")
+ if ! echo "$result" | grep -q $OCF_RESKEY_volume_id; then
ocf_exit_reason "volume-id $OCF_RESKEY_volume_id not found"
return $OCF_ERR_CONFIGURED
fi
@@ -156,17 +159,17 @@ osvol_monitor() {
# Is the volue attached?
# We use the API
#
- result=$($OCF_RESKEY_openstackcli volume show \
+ result=$(run_openstackcli "volume show \
--column status \
--column attachments \
--format value \
- $OCF_RESKEY_volume_id)
+ $OCF_RESKEY_volume_id")
- if echo "$result" | grep -q available ; then
+ if echo "$result" | grep -q available; then
ocf_log warn "$OCF_RESKEY_volume_id is not attached to any instance"
return $OCF_NOT_RUNNING
else
- export attached_server_id=$(echo $result|head -n1|
+ export attached_server_id=$(echo "$result"|head -n1|
grep -P -o "'server_id': '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}'"|
grep -P -o "[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}")
ocf_log info "$OCF_RESKEY_volume_id is attached to instance $attached_server_id"
@@ -199,7 +202,7 @@ osvol_stop() {
#
# Detach the volume
#
- if ! $OCF_RESKEY_openstackcli server remove volume $node_id $OCF_RESKEY_volume_id ; then
+ if ! run_openstackcli "server remove volume $node_id $OCF_RESKEY_volume_id"; then
ocf_log error "Couldn't remove volume $OCF_RESKEY_volume_id from instance $node_id"
return $OCF_ERR_GENERIC
fi
@@ -225,7 +228,7 @@ osvol_start() {
# TODO: make it optional in case multi-attachment is allowed by Cinder
#
if [ ! -z $attached_server_id ] ; then
- if ! $OCF_RESKEY_openstackcli server remove volume $attached_server_id $OCF_RESKEY_volume_id ; then
+ if ! run_openstackcli "server remove volume $attached_server_id $OCF_RESKEY_volume_id"; then
ocf_log error "Couldn't remove volume $OCF_RESKEY_volume_id from instance $attached_server_id"
return $OCF_ERR_GENERIC
fi
@@ -238,7 +241,7 @@ osvol_start() {
#
# Attach the volume
#
- $OCF_RESKEY_openstackcli server add volume $node_id $OCF_RESKEY_volume_id
+ run_openstackcli "server add volume $node_id $OCF_RESKEY_volume_id"
if [ $? != $OCF_SUCCESS ]; then
ocf_log error "Couldn't add volume $OCF_RESKEY_volume_id to instance $node_id"
return $OCF_ERR_GENERIC
diff --git a/heartbeat/openstack-common.sh b/heartbeat/openstack-common.sh
index 4763c90db..b6eec09c2 100644
--- a/heartbeat/openstack-common.sh
+++ b/heartbeat/openstack-common.sh
@@ -145,3 +145,25 @@ get_config() {
OCF_RESKEY_openstackcli="${OCF_RESKEY_openstackcli} --os-project-domain-name $OCF_RESKEY_project_domain_name"
fi
}
+
+run_openstackcli() {
+ local cmd="${OCF_RESKEY_openstackcli} $1"
+ local result
+ local rc
+ local start_time=$(date +%s)
+ local end_time
+ local elapsed_time
+
+ result=$($cmd)
+ rc=$?
+ end_time=$(date +%s)
+ elapsed_time=$(expr $end_time - $start_time)
+
+ if [ $elapsed_time -gt 20 ]; then
+ ocf_log warn "$cmd took ${elapsed_time}s to complete"
+ fi
+
+ echo "$result"
+
+ return $rc
+}
diff --git a/heartbeat/openstack-floating-ip b/heartbeat/openstack-floating-ip
index 6e2895654..7317f19a8 100755
--- a/heartbeat/openstack-floating-ip
+++ b/heartbeat/openstack-floating-ip
@@ -101,11 +101,14 @@ END
}
osflip_validate() {
+ local result
+
check_binary "$OCF_RESKEY_openstackcli"
get_config
- if ! $OCF_RESKEY_openstackcli floating ip list|grep -q $OCF_RESKEY_ip_id ; then
+ result=$(run_openstackcli "floating ip list")
+ if ! echo "$result" | grep -q $OCF_RESKEY_ip_id; then
ocf_exit_reason "ip-id $OCF_RESKEY_ip_id not found"
return $OCF_ERR_CONFIGURED
fi
@@ -132,14 +135,14 @@ osflip_monitor() {
| awk '{gsub("[^ ]*:", "");print}')
# Is the IP active and attached?
- result=$($OCF_RESKEY_openstackcli floating ip show \
+ result=$(run_openstackcli "floating ip show \
--column port_id --column floating_ip_address \
--format yaml \
- $OCF_RESKEY_ip_id)
+ $OCF_RESKEY_ip_id")
for port in $node_port_ids ; do
- if echo $result | grep -q $port ; then
- floating_ip=$(echo $result | awk '/floating_ip_address/ {print $2}')
+ if echo "$result" | grep -q $port ; then
+ floating_ip=$(echo "$result" | awk '/floating_ip_address/ {print $2}')
${HA_SBIN_DIR}/attrd_updater ${OCF_RESKEY_delay} -S status -n openstack_floating_ip -v $floating_ip
return $OCF_SUCCESS
@@ -160,7 +163,7 @@ osflip_stop() {
return $OCF_SUCCESS
fi
- if ! $OCF_RESKEY_openstackcli floating ip unset --port $OCF_RESKEY_ip_id ; then
+ if ! run_openstackcli "floating ip unset --port $OCF_RESKEY_ip_id"; then
return $OCF_ERR_GENERIC
fi
@@ -194,7 +197,7 @@ osflip_start() {
ocf_log info "Moving IP address $OCF_RESKEY_ip_id to port ID $node_port_id"
- $OCF_RESKEY_openstackcli floating ip set --port $node_port_id $OCF_RESKEY_ip_id
+ run_openstackcli "floating ip set --port $node_port_id $OCF_RESKEY_ip_id"
if [ $? != $OCF_SUCCESS ]; then
ocf_log error "$OCF_RESKEY_ip_id Cannot be set to port $node_port_id"
return $OCF_ERR_GENERIC
diff --git a/heartbeat/openstack-info.in b/heartbeat/openstack-info.in
index f3a59fc7a..6502f1df1 100755
--- a/heartbeat/openstack-info.in
+++ b/heartbeat/openstack-info.in
@@ -119,9 +119,7 @@ END
#######################################################################
OSInfoStats() {
- local result
local value
- local node
local node_id
get_config
@@ -141,31 +139,33 @@ OSInfoStats() {
${HA_SBIN_DIR}/attrd_updater ${OCF_RESKEY_delay} -n openstack_id -v "$node_id"
# Nova data: flavor
- value=$($OCF_RESKEY_openstackcli server show \
+ value=$(run_openstackcli "server show \
--format value \
--column flavor \
- $node_id)
+ $node_id")
${HA_SBIN_DIR}/attrd_updater ${OCF_RESKEY_delay} -n openstack_flavor -v "$value"
# Nova data: availability zone
- value=$($OCF_RESKEY_openstackcli server show \
+ value=$(run_openstackcli "server show \
--format value \
--column OS-EXT-AZ:availability_zone \
- $node_id)
+ $node_id")
${HA_SBIN_DIR}/attrd_updater ${OCF_RESKEY_delay} -n openstack_az -v "$value"
# Network data: ports
value=""
- for port_id in $($OCF_RESKEY_openstackcli port list \
+ for port_id in $(run_openstackcli "port list \
--format value \
--column id \
- --server $node_id); do
- subnet_id=$($OCF_RESKEY_openstackcli port show \
+ --server $node_id"); do
+ subnet_result=$(run_openstackcli "port show \
--format json \
--column fixed_ips \
- ${port_id} | grep -P '\"subnet_id\": \".*\",$' |
+ ${port_id}")
+ subnet_id=$(echo "$subnet_result" |
+ grep -P '\"subnet_id\": \".*\",$' |
grep -P -o '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}')
value="${value}${subnet_id}:${port_id},"
done
diff --git a/heartbeat/openstack-virtual-ip b/heartbeat/openstack-virtual-ip
index c654d980a..361357d55 100755
--- a/heartbeat/openstack-virtual-ip
+++ b/heartbeat/openstack-virtual-ip
@@ -132,11 +132,11 @@ osvip_monitor() {
node_port_id=$(osvip_port_id)
- result=$($OCF_RESKEY_openstackcli port show \
+ result=$(run_openstackcli "port show \
--format value \
--column allowed_address_pairs \
- ${node_port_id})
- if echo $result | grep -q "$OCF_RESKEY_ip"; then
+ ${node_port_id}")
+ if echo "$result" | grep -q "$OCF_RESKEY_ip"; then
${HA_SBIN_DIR}/attrd_updater ${OCF_RESKEY_delay} -S status -n openstack_virtual_ip -v $OCF_RESKEY_ip
return $OCF_SUCCESS
@@ -158,20 +158,20 @@ osvip_stop() {
return $OCF_SUCCESS
fi
- mac_address=$($OCF_RESKEY_openstackcli port show \
+ mac_address=$(run_openstackcli "port show \
--format value \
--column mac_address \
- $node_port_id)
- echo ${mac_address} | grep -q -P "^([0-9a-f]{2}:){5}[0-9a-f]{2}$"
+ $node_port_id")
+ echo "${mac_address}" | grep -q -P "^([0-9a-f]{2}:){5}[0-9a-f]{2}$"
if [ $? -ne 0 ]; then
ocf_log error "MAC address '${mac_address}' is not valid."
return $OCF_ERR_GENERIC
fi
- if ! $OCF_RESKEY_openstackcli port unset \
+ if ! run_openstackcli "port unset \
--allowed-address \
ip-address=$OCF_RESKEY_ip,mac-address=${mac_address} \
- $node_port_id; then
+ $node_port_id"; then
return $OCF_ERR_GENERIC
fi
@@ -196,9 +196,9 @@ osvip_start() {
ocf_log info "Moving IP address $OCF_RESKEY_ip to port ID $node_port_id"
- $OCF_RESKEY_openstackcli port set \
+ run_openstackcli "port set \
--allowed-address ip-address=$OCF_RESKEY_ip \
- $node_port_id
+ $node_port_id"
if [ $? != $OCF_SUCCESS ]; then
ocf_log error "$OCF_RESKEY_ip Cannot be set to port $node_port_id"
return $OCF_ERR_GENERIC

View File

@ -0,0 +1,72 @@
From 64f434014bc198055478a139532c7cc133967c5d Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Fri, 8 Jul 2022 15:41:34 +0200
Subject: [PATCH] openstack-agents: fixes
- openstack-cinder-volume: dont do volume_local_check during start/stop-action
- openstack-floating-ip/openstack-virtual-ip: dont fail in validate()
during probe-calls
- openstack-floating-ip: fix awk only catching last id for node_port_ids
---
heartbeat/openstack-cinder-volume | 2 +-
heartbeat/openstack-floating-ip | 4 ++--
heartbeat/openstack-virtual-ip | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/heartbeat/openstack-cinder-volume b/heartbeat/openstack-cinder-volume
index cc12e58ae..19bf04faf 100755
--- a/heartbeat/openstack-cinder-volume
+++ b/heartbeat/openstack-cinder-volume
@@ -138,7 +138,7 @@ osvol_monitor() {
node_id=$(_get_node_id)
- if ocf_is_true $OCF_RESKEY_volume_local_check ; then
+ if [ "$__OCF_ACTION" = "monitor" ] && ocf_is_true $OCF_RESKEY_volume_local_check ; then
#
# Is the volue attached?
# We check the local devices
diff --git a/heartbeat/openstack-floating-ip b/heartbeat/openstack-floating-ip
index 8c135cc24..6e2895654 100755
--- a/heartbeat/openstack-floating-ip
+++ b/heartbeat/openstack-floating-ip
@@ -111,7 +111,7 @@ osflip_validate() {
fi
${HA_SBIN_DIR}/attrd_updater --query -n openstack_ports -N $(crm_node -n) > /dev/null 2>&1
- if [ $? -ne 0 ] ; then
+ if [ $? -ne 0 ] && ! ocf_is_probe; then
ocf_log warn "attr_updater failed to get openstack_ports attribute of node $OCF_RESOURCE_INSTANCE"
return $OCF_ERR_GENERIC
fi
@@ -129,7 +129,7 @@ osflip_monitor() {
node_port_ids=$(${HA_SBIN_DIR}/attrd_updater --query -n openstack_ports -N $(crm_node -n) \
| awk -F= '{gsub("\"","");print $NF}' \
| tr ',' ' ' \
- | awk -F: '{print $NF}')
+ | awk '{gsub("[^ ]*:", "");print}')
# Is the IP active and attached?
result=$($OCF_RESKEY_openstackcli floating ip show \
diff --git a/heartbeat/openstack-virtual-ip b/heartbeat/openstack-virtual-ip
index a1084c420..c654d980a 100755
--- a/heartbeat/openstack-virtual-ip
+++ b/heartbeat/openstack-virtual-ip
@@ -119,7 +119,7 @@ osvip_validate() {
get_config
${HA_SBIN_DIR}/attrd_updater --query -n openstack_ports -N $(crm_node -n) > /dev/null 2>&1
- if [ $? -ne 0 ] ; then
+ if [ $? -ne 0 ] && ! ocf_is_probe; then
ocf_log warn "attr_updater failed to get openstack_ports attribute of node $OCF_RESOURCE_INSTANCE"
return $OCF_ERR_GENERIC
fi
@@ -136,7 +136,7 @@ osvip_monitor() {
--format value \
--column allowed_address_pairs \
${node_port_id})
- if echo $result | grep -q $OCF_RESKEY_ip ; then
+ if echo $result | grep -q "$OCF_RESKEY_ip"; then
${HA_SBIN_DIR}/attrd_updater ${OCF_RESKEY_delay} -S status -n openstack_virtual_ip -v $OCF_RESKEY_ip
return $OCF_SUCCESS

View File

@ -0,0 +1,26 @@
From 8b1d3257e5176a2f50a843a21888c4b4f51f370b Mon Sep 17 00:00:00 2001
From: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Date: Sun, 3 Apr 2022 20:31:50 +0200
Subject: [PATCH] openstack-info: fix bashism
Also simplify striping of trailing comma.
---
heartbeat/openstack-info.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/heartbeat/openstack-info.in b/heartbeat/openstack-info.in
index f6dc1ee4d..f3a59fc7a 100755
--- a/heartbeat/openstack-info.in
+++ b/heartbeat/openstack-info.in
@@ -167,9 +167,9 @@ OSInfoStats() {
--column fixed_ips \
${port_id} | grep -P '\"subnet_id\": \".*\",$' |
grep -P -o '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}')
- value+="${subnet_id}:${port_id},"
+ value="${value}${subnet_id}:${port_id},"
done
- value=$(echo ${value} | sed -e 's/,$//g')
+ value=${value%,}
${HA_SBIN_DIR}/attrd_updater ${OCF_RESKEY_delay} -n openstack_ports -v "$value"

View File

@ -0,0 +1,39 @@
From 46e8d346ca4803245f51a157591c4df1126d3b49 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Tue, 12 Jul 2022 12:45:52 +0200
Subject: [PATCH] ocf-tester: use promotable terms
---
tools/ocf-tester.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/ocf-tester.in b/tools/ocf-tester.in
index 10822a5a06..f1703ba1b7 100755
--- a/tools/ocf-tester.in
+++ b/tools/ocf-tester.in
@@ -295,10 +295,10 @@ if [ $rc -eq 3 ]; then
elif [ $rc -eq 8 ]; then
test_command demote "Cleanup, demote"
- assert $? 0 "Your agent was a master and could not be demoted" 1
+ assert $? 0 "Your agent was promoted and could not be demoted" 1
test_command stop "Cleanup, stop"
- assert $? 0 "Your agent was a master and could not be stopped" 1
+ assert $? 0 "Your agent was promoted and could not be stopped" 1
elif [ $rc -ne 7 ]; then
test_command stop
@@ -370,10 +370,10 @@ if [ $has_promote -eq 1 -a $has_demote -eq 1 ]; then
assert $? 0 "Demote failed" 1
elif [ $has_promote -eq 0 -a $has_demote -eq 0 ]; then
- info "* Your agent does not support master/slave (optional)"
+ info "* Your agent does not support promotable clones (optional)"
else
- echo "* Your agent partially supports master/slave"
+ echo "* Your agent partially supports promotable clones"
num_errors=`expr $num_errors + 1`
fi

View File

@ -0,0 +1,166 @@
From 687aa646852d5fd5d4e811b2ec562ebffa15e23d Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Thu, 14 Jul 2022 14:52:07 +0200
Subject: [PATCH] ocf-tester: remove deprecated lrmd/lrmadmin code that hasnt
worked since pre-pacemaker days
---
tools/ocf-tester.8 | 12 ++-----
tools/ocf-tester.in | 81 ---------------------------------------------
2 files changed, 2 insertions(+), 91 deletions(-)
diff --git a/tools/ocf-tester.8 b/tools/ocf-tester.8
index 850ec0be04..3f398282d2 100644
--- a/tools/ocf-tester.8
+++ b/tools/ocf-tester.8
@@ -1,9 +1,9 @@
-.TH OCF-TESTER "8" "January 2012" "Tool for testing if a cluster resource is OCF compliant" "System Administration Utilities"
+.TH OCF-TESTER "8" "July 2022" "Tool for testing if a cluster resource is OCF compliant" "System Administration Utilities"
.SH NAME
ocf-tester \- Part of the Linux-HA project
.SH SYNOPSIS
.B ocf-tester
-[\fI-LhvqdX\fR] \fI-n resource_name \fR[\fI-o name=value\fR]\fI* /full/path/to/resource/agent\fR
+[\fI-hvqdX\fR] \fI-n resource_name \fR[\fI-o name=value\fR]\fI* /full/path/to/resource/agent\fR
.SH DESCRIPTION
Tool for testing if a cluster resource is OCF compliant
.SH OPTIONS
@@ -26,11 +26,6 @@ Name of the resource
\fB\-o\fR name=value
Name and value of any parameters required by the agent
.TP
-\fB\-L\fR
-Use lrmadmin/lrmd for tests
-.PP
-Usage: ocf\-tester [\-Lh] \fB\-n\fR resource_name [\-o name=value]* /full/path/to/resource/agent
-.TP
\fB\-h\fR
This text
.TP
@@ -51,6 +46,3 @@ Name of the resource
.TP
\fB\-o\fR name=value
Name and value of any parameters required by the agent
-.TP
-\fB\-L\fR
-Use lrmadmin/lrmd for tests
diff --git a/tools/ocf-tester.in b/tools/ocf-tester.in
index 10822a5a06..15b14e51ea 100755
--- a/tools/ocf-tester.in
+++ b/tools/ocf-tester.in
@@ -25,8 +25,6 @@
# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
-LRMD=@libdir@/heartbeat/lrmd
-LRMADMIN=@sbindir@/lrmadmin
DATADIR=@datadir@
METADATA_LINT="xmllint --noout --valid -"
@@ -61,7 +59,6 @@ usage() {
echo " -X Turn on RA tracing (expect large output)"
echo " -n name Name of the resource"
echo " -o name=value Name and value of any parameters required by the agent"
- echo " -L Use lrmadmin/lrmd for tests"
exit $1
}
@@ -104,7 +101,6 @@ while test "$done" = "0"; do
-o) name=${2%%=*}; value=${2#*=};
lrm_ra_args="$lrm_ra_args $2";
ra_args="$ra_args OCF_RESKEY_$name='$value'"; shift; shift;;
- -L) use_lrmd=1; shift;;
-v) verbose=1; shift;;
-d) export HA_debug=1; shift;;
-X) export OCF_TRACE_RA=1; verbose=1; shift;;
@@ -140,79 +136,6 @@ stopped_rc=7
has_demote=1
has_promote=1
-start_lrmd() {
- lrmd_timeout=0
- lrmd_interval=0
- lrmd_target_rc=EVERYTIME
- lrmd_started=""
- $LRMD -s 2>/dev/null
- rc=$?
- if [ $rc -eq 3 ]; then
- lrmd_started=1
- $LRMD &
- sleep 1
- $LRMD -s 2>/dev/null
- else
- return $rc
- fi
-}
-add_resource() {
- $LRMADMIN -A $OCF_RESOURCE_INSTANCE \
- ocf \
- `basename $agent` \
- $(basename `dirname $agent`) \
- $lrm_ra_args > /dev/null
-}
-del_resource() {
- $LRMADMIN -D $OCF_RESOURCE_INSTANCE
-}
-parse_lrmadmin_output() {
- awk '
-BEGIN{ rc=1; }
-/Waiting for lrmd to callback.../ { n=1; next; }
-n==1 && /----------------operation--------------/ { n++; next; }
-n==2 && /return code:/ { rc=$0; sub("return code: *","",rc); next }
-n==2 && /---------------------------------------/ {
- n++;
- next;
-}
-END{
- if( n!=3 ) exit 1;
- else exit rc;
-}
-'
-}
-exec_resource() {
- op="$1"
- args="$2"
- $LRMADMIN -E $OCF_RESOURCE_INSTANCE \
- $op $lrmd_timeout $lrmd_interval \
- $lrmd_target_rc \
- $args | parse_lrmadmin_output
-}
-
-if [ "$use_lrmd" = 1 ]; then
- echo "Using lrmd/lrmadmin for all tests"
- start_lrmd || {
- echo "could not start lrmd" >&2
- exit 1
- }
- trap '
- [ "$lrmd_started" = 1 ] && $LRMD -k
- ' EXIT
- add_resource || {
- echo "failed to add resource to lrmd" >&2
- exit 1
- }
-fi
-
-lrm_test_command() {
- action="$1"
- msg="$2"
- debug "$msg"
- exec_resource $action "$lrm_ra_args"
-}
-
test_permissions() {
action=meta-data
debug ${1:-"Testing permissions with uid nobody"}
@@ -233,10 +156,6 @@ test_command() {
action=$1; shift
export __OCF_ACTION=$action
msg=${1:-"Testing: $action"}
- if [ "$use_lrmd" = 1 ]; then
- lrm_test_command $action "$msg"
- return $?
- fi
#echo Running: "export $ra_args; $agent $action 2>&1 > /dev/null"
if [ $verbose -eq 0 ]; then
command_output=`$agent $action 2>&1`

View File

@ -69,7 +69,7 @@
Name: resource-agents Name: resource-agents
Summary: Open Source HA Reusable Cluster Resource Scripts Summary: Open Source HA Reusable Cluster Resource Scripts
Version: 4.9.0 Version: 4.9.0
Release: 22%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} Release: 27%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
License: GPLv2+ and LGPLv2+ License: GPLv2+ and LGPLv2+
URL: https://github.com/ClusterLabs/resource-agents URL: https://github.com/ClusterLabs/resource-agents
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
@ -112,6 +112,12 @@ Patch20: bz2049414-Filesystem-1-fix-uuid-label-device-whitespace.patch
Patch21: bz2049414-Filesystem-2-improve-uuid-label-device-logic.patch Patch21: bz2049414-Filesystem-2-improve-uuid-label-device-logic.patch
Patch22: bz2086889-lvmlockd-fail-when-use_lvmlockd-not-set.patch Patch22: bz2086889-lvmlockd-fail-when-use_lvmlockd-not-set.patch
Patch23: bz2093214-aws-vpc-move-ip-add-interface-label-support.patch Patch23: bz2093214-aws-vpc-move-ip-add-interface-label-support.patch
Patch24: bz1908148-openstack-info-fix-bashism.patch
Patch25: bz1908146-bz1908147-bz1949114-openstack-agents-fixes.patch
Patch26: bz1908146-bz1908147-bz1908148-bz1949114-openstack-agents-warn-when-openstackcli-slow.patch
Patch27: bz2103370-ocf-tester-1-update.patch
Patch28: bz2103370-ocf-tester-2-remove-deprecated-lrmd-lrmadmin-code.patch
Patch29: bz1908146-bz1908147-bz1908148-bz1949114-openstack-agents-set-domain-parameters-default.patch
# bundle patches # bundle patches
Patch1000: 7-gcp-bundled.patch Patch1000: 7-gcp-bundled.patch
@ -315,6 +321,12 @@ exit 1
%patch21 -p1 %patch21 -p1
%patch22 -p1 %patch22 -p1
%patch23 -p1 %patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
chmod 755 heartbeat/nova-compute-wait chmod 755 heartbeat/nova-compute-wait
chmod 755 heartbeat/NovaEvacuate chmod 755 heartbeat/NovaEvacuate
@ -659,6 +671,7 @@ rm -rf %{buildroot}
%exclude %{_datadir}/%{name}/ocft/runocft %exclude %{_datadir}/%{name}/ocft/runocft
%exclude %{_datadir}/%{name}/ocft/runocft.prereq %exclude %{_datadir}/%{name}/ocft/runocft.prereq
%{_sbindir}/ocf-tester
%{_sbindir}/ocft %{_sbindir}/ocft
%{_includedir}/heartbeat %{_includedir}/heartbeat
@ -670,6 +683,7 @@ rm -rf %{buildroot}
%endif %endif
%{_mandir}/man7/*.7* %{_mandir}/man7/*.7*
%{_mandir}/man8/ocf-tester.8*
### ###
# Supported, but in another sub package # Supported, but in another sub package
@ -825,9 +839,6 @@ rm -rf %{buildroot}
### ###
# Other excluded files. # Other excluded files.
### ###
# This tool has to be updated for the new pacemaker lrmd.
%exclude %{_sbindir}/ocf-tester
%exclude %{_mandir}/man8/ocf-tester.8*
# ldirectord is not supported # ldirectord is not supported
%exclude /etc/ha.d/resource.d/ldirectord %exclude /etc/ha.d/resource.d/ldirectord
%exclude /etc/init.d/ldirectord %exclude /etc/init.d/ldirectord
@ -891,6 +902,17 @@ ccs_update_schema > /dev/null 2>&1 ||:
%{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm
%changelog %changelog
* Thu Jul 14 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.9.0-27
- ocf-tester: add testing tool
Resolves: rhbz#2103370
* Thu Jul 14 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.9.0-26
- openstack-cinder-volume/openstack-floating-ip/openstack-info/
openstack-virtual-ip: new resource agents
Resolves: rhbz#1908146, rhbz#1908147, rhbz#1908148, rhbz#1949114
* Thu Jun 16 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.9.0-22 * Thu Jun 16 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.9.0-22
- gcp-vpc-move-route/gcp-vpc-move-vip: upgrade bundled - gcp-vpc-move-route/gcp-vpc-move-vip: upgrade bundled
python-httplib2 to fix SSL issue python-httplib2 to fix SSL issue
@ -918,12 +940,6 @@ ccs_update_schema > /dev/null 2>&1 ||:
Resolves: rhbz#2072043 Resolves: rhbz#2072043
* Wed Mar 16 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.9.0-17
- openstack-cinder-volume/openstack-floating-ip/openstack-info/
openstack-virtual-ip: new resource agents
Resolves: rhbz#1908146, rhbz#1908147, rhbz#1908148, rhbz#1949114
* Thu Mar 3 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.9.0-16 * Thu Mar 3 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.9.0-16
- IPsrcaddr: add warning about possible issues when used with DHCP, - IPsrcaddr: add warning about possible issues when used with DHCP,
and add error message when matching route not found and add error message when matching route not found