Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package resource-agents for openSUSE:Factory checked in at 2025-01-29 16:09:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/resource-agents (Old) and /work/SRC/openSUSE:Factory/.resource-agents.new.2316 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "resource-agents" Wed Jan 29 16:09:36 2025 rev:135 rq:1241131 version:4.16.0+git38.da9ef4e2 Changes: -------- --- /work/SRC/openSUSE:Factory/resource-agents/resource-agents.changes 2024-11-29 00:08:12.999763748 +0100 +++ /work/SRC/openSUSE:Factory/.resource-agents.new.2316/resource-agents.changes 2025-01-29 16:09:42.929815588 +0100 @@ -1,0 +2,30 @@ +Tue Jan 28 15:57:41 UTC 2025 - Peter Varkoly <vark...@suse.com> + +- drop HA package cluster-glue and Linux-HA style fence agents in FrameworkOne + (jsc#PED-8498) + Remove dependency: cluster-glue-devel. As a result of this sfex_init, sfex_stat, + resource-agents-deps.target and ldirectord.service were removed also. +- Update to version 4.16.0+git38.da9ef4e2: + * storage-mon: log "storage_mon is already running" in start-action + * storage-mon: check if daemon is already running during start-action + * storage-mon: replace dashes with underscores in functions + * ocf-binaries: add FGREP + * Filesystem: dont report warnings when creating a Filesystem resource + * ibm-cloud-vpc-move-fip: new resource agent (#2008) + * ibm-cloud-vpc-cr-vip: fix ImportError logging + * All agents: use detected grep -E/-F instead of egrep/fgrep when detected + * ibm-cloud-vpc-cr-vip: dont build if ibm_cloud_fail_over is not installed + * nfsserver: dont use init-scripts if systemd is running + * ibm-cloud-vpc-cr-vip: new resource agent (#2002) + * ocf-shellfuncs: fixed bash systax error added at a25f08cf98d784894df9c52960eff5ccef059393 + * openstack-cinder-volume: fix detach not working during start-action after #2000 + * openstack-cinder-volume: wait for volume to be available + * spec: update Requires paths for RHEL10/CentOS 10 + * awsvip: let user specify which interface to use, and make the parameter optional in aws-vpc-move-ip + * aws.sh: add get_interface_mac() + * Mid: storage-mon RA: Wait until monitor confirms the startup pid according to the OCF resource specification. + * High: storage-mon: Correct the timing of setting notification values to storage-mon(RA) clients. + * aws.sh/ocf-shellfuncs: add ability to fresh token if it's invalid + * aws.sh: chmod 600 $TOKEN_FILE, add get_instance_id() with DMI support, and use get_instance_id() in AWS agents + +------------------------------------------------------------------- Old: ---- resource-agents-4.16.0+git2.20a433c3.tar.xz New: ---- resource-agents-4.16.0+git38.da9ef4e2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ resource-agents.spec ++++++ --- /var/tmp/diff_new_pack.MKT7aH/_old 2025-01-29 16:09:43.593843124 +0100 +++ /var/tmp/diff_new_pack.MKT7aH/_new 2025-01-29 16:09:43.593843124 +0100 @@ -1,7 +1,7 @@ # # spec file for package resource-agents # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: resource-agents -Version: 4.16.0+git2.20a433c3 +Version: 4.16.0+git38.da9ef4e2 Release: 0 Summary: HA Reusable Cluster Resource Scripts License: GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later @@ -47,7 +47,6 @@ BuildRequires: %{python_module urllib3} BuildRequires: autoconf BuildRequires: automake -BuildRequires: cluster-glue-devel BuildRequires: docbook-xsl-stylesheets BuildRequires: docbook_4 BuildRequires: libqb-devel @@ -213,10 +212,7 @@ %{_prefix}/lib/ocf/lib/heartbeat %{_sbindir}/ocf-tester %{_sbindir}/ocft -%{_sbindir}/sfex_init -%{_sbindir}/sfex_stat %{_includedir}/heartbeat -%{_unitdir}/resource-agents-deps.target %ghost %dir %attr (1755, root, root) %{_rundir}/resource-agents %doc AUTHORS %license COPYING @@ -226,7 +222,6 @@ %{_mandir}/man7/*.7* %exclude %{_mandir}/man7/ocf_heartbeat_ZFS.* %{_mandir}/man8/ocf-tester.8* -%{_mandir}/man8/sfex_init.8* %doc doc/README.webapps # For compatability with pre-existing agents %dir %{_sysconfdir}/ha.d @@ -246,7 +241,6 @@ %dir %{_sysconfdir}/ha.d/resource.d %{_sbindir}/ldirectord %{_sbindir}/rcldirectord -%{_unitdir}/ldirectord.service %exclude %{_sysconfdir}/init.d/ldirectord %{_sysconfdir}/ha.d/resource.d/ldirectord %config(noreplace) %{_sysconfdir}/logrotate.d/ldirectord ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.MKT7aH/_old 2025-01-29 16:09:43.645845281 +0100 +++ /var/tmp/diff_new_pack.MKT7aH/_new 2025-01-29 16:09:43.645845281 +0100 @@ -1,7 +1,7 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/ClusterLabs/resource-agents.git</param> -<param name="changesrevision">20a433c39ceff08c91316695fa2e99519a4ed302</param> +<param name="changesrevision">de51a1705ce761f1fb5f1b2294cfc1153af70c1c</param> </service> </servicedata> (No newline at EOF) ++++++ resource-agents-4.16.0+git2.20a433c3.tar.xz -> resource-agents-4.16.0+git38.da9ef4e2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/.gitignore new/resource-agents-4.16.0+git38.da9ef4e2/.gitignore --- old/resource-agents-4.16.0+git2.20a433c3/.gitignore 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/.gitignore 2025-01-28 09:10:22.000000000 +0100 @@ -66,6 +66,8 @@ heartbeat/gcp-vpc-move-ip heartbeat/gcp-vpc-move-route heartbeat/gcp-vpc-move-vip +heartbeat/ibm-cloud-vpc-cr-vip +heartbeat/ibm-cloud-vpc-move-fip heartbeat/iSCSILogicalUnit heartbeat/iSCSITarget heartbeat/jira diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/configure.ac new/resource-agents-4.16.0+git38.da9ef4e2/configure.ac --- old/resource-agents-4.16.0+git2.20a433c3/configure.ac 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/configure.ac 2025-01-28 09:10:22.000000000 +0100 @@ -492,12 +492,12 @@ AC_PATH_PROGS(PING, ping, /bin/ping) AC_PATH_PROGS(IFCONFIG, ifconfig, /sbin/ifconfig) AC_PATH_PROGS(MAILCMD, mailx mail, mail) -AC_PATH_PROGS(EGREP, egrep) AC_PATH_PROGS(RM, rm) +AC_PROG_EGREP +AC_PROG_FGREP AC_SUBST(BASH_SHELL) AC_SUBST(MAILCMD) -AC_SUBST(EGREP) AC_SUBST(SHELL) AC_SUBST(PING) AC_SUBST(RM) @@ -521,6 +521,7 @@ AC_PYTHON_MODULE(pyroute2) AC_PYTHON_MODULE(requests) AC_PYTHON_MODULE(urllib3) +AC_PYTHON_MODULE(ibm_cloud_fail_over) AS_VERSION_COMPARE([$PYTHON_VERSION], [3.6], [BUILD_OCF_PY=0], [BUILD_OCF_PY=1], [BUILD_OCF_PY=1]) @@ -566,6 +567,20 @@ fi AM_CONDITIONAL(BUILD_POWERVS_SUBNET, test $BUILD_POWERVS_SUBNET -eq 1) +BUILD_IBM_CLOUD_VPC_MOVE_ROUTE=1 +if test -z "$PYTHON" || test $BUILD_OCF_PY -eq 0 || test "x${HAVE_PYMOD_IBM_CLOUD_FAIL_OVER}" != xyes; then + BUILD_IBM_CLOUD_VPC_MOVE_ROUTE=0 + AC_MSG_WARN("Not building ibm-cloud-vpc-cr-vip") +fi +AM_CONDITIONAL(BUILD_IBM_CLOUD_VPC_MOVE_ROUTE, test $BUILD_IBM_CLOUD_VPC_MOVE_ROUTE -eq 1) + +BUILD_IBM_CLOUD_VPC_MOVE_FIP=1 +if test -z "$PYTHON" || test $BUILD_OCF_PY -eq 0 || test "x${HAVE_PYMOD_IBM_CLOUD_FAIL_OVER}" != xyes; then + BUILD_IBM_CLOUD_VPC_MOVE_FIP=0 + AC_MSG_WARN("Not building ibm-cloud-vpc-move-fip") +fi +AM_CONDITIONAL(BUILD_IBM_CLOUD_VPC_MOVE_FIP, test $BUILD_IBM_CLOUD_VPC_MOVE_FIP -eq 1) + AC_PATH_PROGS(ROUTE, route) AC_DEFINE_UNQUOTED(ROUTE, "$ROUTE", path to route command) @@ -1016,6 +1031,8 @@ AC_CONFIG_FILES([heartbeat/gcp-vpc-move-ip], [chmod +x heartbeat/gcp-vpc-move-ip]) AC_CONFIG_FILES([heartbeat/gcp-vpc-move-vip], [chmod +x heartbeat/gcp-vpc-move-vip]) AC_CONFIG_FILES([heartbeat/gcp-vpc-move-route], [chmod +x heartbeat/gcp-vpc-move-route]) +AC_CONFIG_FILES([heartbeat/ibm-cloud-vpc-cr-vip], [chmod +x heartbeat/ibm-cloud-vpc-cr-vip]) +AC_CONFIG_FILES([heartbeat/ibm-cloud-vpc-move-fip], [chmod +x heartbeat/ibm-cloud-vpc-move-fip]) AC_CONFIG_FILES([heartbeat/iSCSILogicalUnit], [chmod +x heartbeat/iSCSILogicalUnit]) AC_CONFIG_FILES([heartbeat/iSCSITarget], [chmod +x heartbeat/iSCSITarget]) AC_CONFIG_FILES([heartbeat/jira], [chmod +x heartbeat/jira]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/doc/man/Makefile.am new/resource-agents-4.16.0+git38.da9ef4e2/doc/man/Makefile.am --- old/resource-agents-4.16.0+git2.20a433c3/doc/man/Makefile.am 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/doc/man/Makefile.am 2025-01-28 09:10:22.000000000 +0100 @@ -241,6 +241,14 @@ man_MANS += ocf_heartbeat_powervs-subnet.7 endif +if BUILD_IBM_CLOUD_VPC_MOVE_ROUTE +man_MANS += ocf_heartbeat_ibm-cloud-vpc-cr-vip.7 +endif + +if BUILD_IBM_CLOUD_VPC_MOVE_FIP +man_MANS += ocf_heartbeat_ibm-cloud-vpc-move-fip.7 +endif + xmlfiles = $(man_MANS:.7=.xml) %.1 %.5 %.7 %.8: %.xml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/Filesystem new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/Filesystem --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/Filesystem 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/Filesystem 2025-01-28 09:10:22.000000000 +0100 @@ -1145,7 +1145,7 @@ check_binary $MOUNT check_binary $UMOUNT -if [ "$OP" != "monitor" ]; then +if [ "$OP" != "monitor" ] && [ "$OP" != "validate-all" ]; then ocf_log info "Running $OP for $DEVICE on $MOUNTPOINT" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/IPaddr2 new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/IPaddr2 --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/IPaddr2 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/IPaddr2 2025-01-28 09:10:22.000000000 +0100 @@ -1028,7 +1028,7 @@ echo "partial2" return 0 fi - if egrep -q "(^|,)${IP_INC_NO}(,|$)" $IP_CIP_FILE ; then + if $EGREP -q "(^|,)${IP_INC_NO}(,|$)" $IP_CIP_FILE ; then echo "ok" return 0 else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/Makefile.am new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/Makefile.am --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/Makefile.am 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/Makefile.am 2025-01-28 09:10:22.000000000 +0100 @@ -210,6 +210,14 @@ ocf_SCRIPTS += powervs-subnet endif +if BUILD_IBM_CLOUD_VPC_MOVE_ROUTE +ocf_SCRIPTS += ibm-cloud-vpc-cr-vip +endif + +if BUILD_IBM_CLOUD_VPC_MOVE_FIP +ocf_SCRIPTS += ibm-cloud-vpc-move-fip +endif + ocfcommondir = $(OCF_LIB_DIR_PREFIX)/heartbeat ocfcommon_DATA = ocf-shellfuncs \ ocf-binaries \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/ManageVE.in new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/ManageVE.in --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/ManageVE.in 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/ManageVE.in 2025-01-28 09:10:22.000000000 +0100 @@ -273,7 +273,7 @@ declare -i veidtest1=$? # really a number? -`echo "$OCF_RESKEY_veid" | egrep -q '^[[:digit:]]+$'` +`echo "$OCF_RESKEY_veid" | $EGREP -q '^[[:digit:]]+$'` if [[ $veidtest1 != 1 || $? != 0 ]]; then ocf_log err "OCF_RESKEY_veid not set or not a number." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/SAPInstance new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/SAPInstance --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/SAPInstance 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/SAPInstance 2025-01-28 09:10:22.000000000 +0100 @@ -795,7 +795,7 @@ esac SEARCH=`echo "$OCF_RESKEY_MONITOR_SERVICES" | sed 's/\+/\\\+/g' | sed 's/\./\\\./g'` - if [ `echo "$SERVICE" | egrep -c "$SEARCH"` -eq 1 ] + if [ `echo "$SERVICE" | $EGREP -c "$SEARCH"` -eq 1 ] then if [ $STATE -eq $OCF_NOT_RUNNING ] then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/VirtualDomain new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/VirtualDomain --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/VirtualDomain 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/VirtualDomain 2025-01-28 09:10:22.000000000 +0100 @@ -975,7 +975,7 @@ sed "s/%n/$target_node/g"` # extract migrationuri from options - elif echo "$migrate_opts" | fgrep -qs -- "--migrateuri="; then + elif echo "$migrate_opts" | $FGREP -qs -- "--migrateuri="; then migrateuri=`echo "$migrate_opts" | sed "s/.*--migrateuri=\([^ ]*\).*/\1/;s/%n/$target_node/g"` @@ -1148,7 +1148,7 @@ VIRSH_OPTIONS="--connect=${OCF_RESKEY_hypervisor} --quiet" # Retrieve the domain name from the xml file. - DOMAIN_NAME=`egrep '[[:space:]]*<name>.*</name>[[:space:]]*$' ${OCF_RESKEY_config} 2>/dev/null | sed -e 's/[[:space:]]*<name>\(.*\)<\/name>[[:space:]]*$/\1/'` + DOMAIN_NAME=`$EGREP '[[:space:]]*<name>.*</name>[[:space:]]*$' ${OCF_RESKEY_config} 2>/dev/null | sed -e 's/[[:space:]]*<name>\(.*\)<\/name>[[:space:]]*$/\1/'` EMULATOR_STATE="${HA_RSCTMP}/VirtualDomain-${DOMAIN_NAME}-emu.state" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/WAS new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/WAS --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/WAS 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/WAS 2025-01-28 09:10:22.000000000 +0100 @@ -227,7 +227,7 @@ esac PortCount=`expr $PortCount + 1` done - netstat -ltnp 2>/dev/null| egrep -i "($pat) .*LISTEN" | sed 's%.*LISTEN *%%' + netstat -ltnp 2>/dev/null| $EGREP -i "($pat) .*LISTEN" | sed 's%.*LISTEN *%%' } # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/WAS6 new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/WAS6 --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/WAS6 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/WAS6 2025-01-28 09:10:22.000000000 +0100 @@ -196,7 +196,7 @@ esac PortCount=`expr $PortCount + 1` done - netstat -ltnp 2>/dev/null| egrep -i "($pat) .*LISTEN" | sed 's%.*LISTEN *%%' + netstat -ltnp 2>/dev/null| $EGREP -i "($pat) .*LISTEN" | sed 's%.*LISTEN *%%' } # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/aws-vpc-move-ip new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/aws-vpc-move-ip --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/aws-vpc-move-ip 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/aws-vpc-move-ip 2025-01-28 09:10:22.000000000 +0100 @@ -157,7 +157,7 @@ <content type="string" default="${OCF_RESKEY_routing_table_role_default}" /> </parameter> -<parameter name="interface" required="1"> +<parameter name="interface" required="0"> <longdesc lang="en"> Name of the network interface, i.e. eth0 </longdesc> @@ -269,7 +269,7 @@ TOKEN=$(get_token) [ $? -ne 0 ] && exit $OCF_ERR_GENERIC - EC2_INSTANCE_ID=$(curl_retry "$OCF_RESKEY_curl_retries" "$OCF_RESKEY_curl_sleep" "--show-error -s -H 'X-aws-ec2-metadata-token: $TOKEN'" "http://169.254.169.254/latest/meta-data/instance-id") + EC2_INSTANCE_ID=$(get_instance_id) [ $? -ne 0 ] && exit $OCF_ERR_GENERIC if [ -z "${EC2_INSTANCE_ID}" ]; then @@ -321,7 +321,7 @@ ocf_log debug "monitor: Enhanced Monitoring disabled - omitting API call" fi - cmd="ip addr show to $OCF_RESKEY_ip up" + cmd="ip addr show dev $OCF_RESKEY_interface to $OCF_RESKEY_ip up" ocf_log debug "executing command: $cmd" RESULT=$($cmd | grep "$OCF_RESKEY_ip") if [ -z "$RESULT" ]; then @@ -331,7 +331,7 @@ level="info" fi - ocf_log "$level" "IP $OCF_RESKEY_ip not assigned to running interface" + ocf_log "$level" "IP $OCF_RESKEY_ip not assigned to interface $OCF_RESKEY_interface" return $OCF_NOT_RUNNING fi @@ -369,19 +369,7 @@ } ec2ip_get_instance_eni() { - MAC_FILE="/sys/class/net/${OCF_RESKEY_interface}/address" - if [ -f $MAC_FILE ]; then - cmd="cat ${MAC_FILE}" - else - cmd="ip -br link show dev ${OCF_RESKEY_interface} | tr -s ' ' | cut -d' ' -f3" - fi - ocf_log debug "executing command: $cmd" - MAC_ADDR="$(eval $cmd)" - rc=$? - if [ $rc != 0 ]; then - ocf_log warn "command failed, rc: $rc" - return $OCF_ERR_GENERIC - fi + MAC_ADDR=$(get_interface_mac) ocf_log debug "MAC address associated with interface ${OCF_RESKEY_interface}: ${MAC_ADDR}" cmd="curl_retry \"$OCF_RESKEY_curl_retries\" \"$OCF_RESKEY_curl_sleep\" \"--show-error -s -H 'X-aws-ec2-metadata-token: $TOKEN'\" \"http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MAC_ADDR}/interface-id\"" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/aws.sh new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/aws.sh --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/aws.sh 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/aws.sh 2025-01-28 09:10:22.000000000 +0100 @@ -9,8 +9,8 @@ . ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs # Defaults -OCF_RESKEY_curl_retries_default="3" -OCF_RESKEY_curl_sleep_default="1" +OCF_RESKEY_curl_retries_default="4" +OCF_RESKEY_curl_sleep_default="3" : ${OCF_RESKEY_curl_retries=${OCF_RESKEY_curl_retries_default}} : ${OCF_RESKEY_curl_sleep=${OCF_RESKEY_curl_sleep_default}} @@ -18,13 +18,16 @@ # Function to enable reusable IMDS token retrieval for efficient repeated access # File to store the token and timestamp TOKEN_FILE="${HA_RSCTMP}/.aws_imds_token" +TOKEN_FUNC="fetch_new_token" # Used by curl_retry() if saved token is invalid TOKEN_LIFETIME=21600 # Token lifetime in seconds (6 hours) TOKEN_EXPIRY_THRESHOLD=3600 # Renew token if less than 60 minutes (1 hour) remaining +DMI_FILE="/sys/devices/virtual/dmi/id/board_asset_tag" # Only supported on nitro-based instances. # Function to fetch a new token fetch_new_token() { TOKEN=$(curl_retry "$OCF_RESKEY_curl_retries" "$OCF_RESKEY_curl_sleep" "--show-error -sX PUT -H 'X-aws-ec2-metadata-token-ttl-seconds: $TOKEN_LIFETIME'" "http://169.254.169.254/latest/api/token") echo "$TOKEN $(date +%s)" > "$TOKEN_FILE" + chmod 600 "$TOKEN_FILE" echo "$TOKEN" } @@ -43,4 +46,49 @@ fi # Fetch a new token if not valid fetch_new_token -} \ No newline at end of file +} + +get_instance_id() { + local INSTANCE_ID + + # Try to get the EC2 instance ID from DMI first before falling back to IMDS. + ocf_log debug "EC2: Attempt to get EC2 Instance ID from local file." + if [ -r "$DMI_FILE" ] && [ -s "$DMI_FILE" ]; then + INSTANCE_ID="$(cat "$DMI_FILE")" + case "$INSTANCE_ID" in + i-0*) echo "$INSTANCE_ID"; return "$OCF_SUCCESS" ;; + esac + fi + + INSTANCE_ID=$(curl_retry "$OCF_RESKEY_curl_retries" "$OCF_RESKEY_curl_sleep" "--show-error -s -H 'X-aws-ec2-metadata-token: $TOKEN'" "http://169.254.169.254/latest/meta-data/instance-id") + if [ $? -ne 0 ]; then + ocf_exit_reason "Failed to get EC2 Instance ID" + exit $OCF_ERR_GENERIC + fi + + echo "$INSTANCE_ID" + return "$OCF_SUCCESS" +} + +get_interface_mac() { + local MAC_FILE MAC_ADDR rc + MAC_FILE="/sys/class/net/${OCF_RESKEY_interface}/address" + if [ -z "$OCF_RESKEY_interface" ]; then + cmd="curl_retry \"$OCF_RESKEY_curl_retries\" \"$OCF_RESKEY_curl_sleep\" \"--show-error -s -H 'X-aws-ec2-metadata-token: $TOKEN'\" \"http://169.254.169.254/latest/meta-data/mac\"" + elif [ -f "$MAC_FILE" ]; then + cmd="cat ${MAC_FILE}" + else + cmd="ip -br link show dev ${OCF_RESKEY_interface} | tr -s ' ' | cut -d' ' -f3" + fi + ocf_log debug "executing command: $cmd" + MAC_ADDR="$(eval $cmd)" + rc=$? + if [ $rc != 0 ]; then + ocf_log warn "command failed, rc: $rc" + return $OCF_ERR_GENERIC + fi + ocf_log debug "MAC address associated with interface ${OCF_RESKEY_interface}: ${MAC_ADDR}" + + echo $MAC_ADDR + return $OCF_SUCCESS +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/awseip new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/awseip --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/awseip 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/awseip 2025-01-28 09:10:22.000000000 +0100 @@ -305,7 +305,7 @@ PRIVATE_IP_ADDRESS="${OCF_RESKEY_private_ip_address}" TOKEN=$(get_token) [ $? -ne 0 ] && exit $OCF_ERR_GENERIC -INSTANCE_ID=$(curl_retry "$OCF_RESKEY_curl_retries" "$OCF_RESKEY_curl_sleep" "--show-error -s -H 'X-aws-ec2-metadata-token: $TOKEN'" "http://169.254.169.254/latest/meta-data/instance-id") +INSTANCE_ID=$(get_instance_id) [ $? -ne 0 ] && exit $OCF_ERR_GENERIC case $__OCF_ACTION in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/awsvip new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/awsvip --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/awsvip 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/awsvip 2025-01-28 09:10:22.000000000 +0100 @@ -49,12 +49,14 @@ OCF_RESKEY_profile_default="default" OCF_RESKEY_region_default="" OCF_RESKEY_api_delay_default="3" +OCF_RESKEY_interface_default="" : ${OCF_RESKEY_awscli=${OCF_RESKEY_awscli_default}} : ${OCF_RESKEY_auth_type=${OCF_RESKEY_auth_type_default}} : ${OCF_RESKEY_profile=${OCF_RESKEY_profile_default}} : ${OCF_RESKEY_region=${OCF_RESKEY_region_default}} : ${OCF_RESKEY_api_delay=${OCF_RESKEY_api_delay_default}} +: ${OCF_RESKEY_interface=${OCF_RESKEY_interface_default}} meta_data() { cat <<END @@ -125,6 +127,14 @@ <content type="integer" default="${OCF_RESKEY_api_delay_default}" /> </parameter> +<parameter name="interface" required="0"> +<longdesc lang="en"> +Name of the network interface, i.e. eth0 +</longdesc> +<shortdesc lang="en">network interface name</shortdesc> +<content type="string" default="${OCF_RESKEY_interface_default}" /> +</parameter> + <parameter name="curl_retries" unique="0"> <longdesc lang="en"> curl retries before failing @@ -207,16 +217,16 @@ } awsvip_monitor() { - $AWSCLI_CMD ec2 describe-instances \ - --instance-id "${INSTANCE_ID}" \ - --query 'Reservations[].Instances[].NetworkInterfaces[].PrivateIpAddresses[].PrivateIpAddress[]' \ + $AWSCLI_CMD ec2 describe-network-interfaces \ + --network-interface-ids "${NETWORK_ID}" \ + --query 'NetworkInterfaces[].PrivateIpAddresses[].PrivateIpAddress[]' \ --output text | \ grep -qE "(^|\s)${SECONDARY_PRIVATE_IP}(\s|$)" - RET=$? - - if [ $RET -ne 0 ]; then + if [ $? -ne 0 ]; then + [ "$__OCF_ACTION" = "monitor" ] && ! ocf_is_probe && ocf_log error "IP $SECONDARY_PRIVATE_IP not assigned to interface ${NETWORK_ID}" return $OCF_NOT_RUNNING fi + return $OCF_SUCCESS } @@ -265,9 +275,9 @@ SECONDARY_PRIVATE_IP="${OCF_RESKEY_secondary_private_ip}" TOKEN=$(get_token) [ $? -ne 0 ] && exit $OCF_ERR_GENERIC -INSTANCE_ID=$(curl_retry "$OCF_RESKEY_curl_retries" "$OCF_RESKEY_curl_sleep" "--show-error -s -H 'X-aws-ec2-metadata-token: $TOKEN'" "http://169.254.169.254/latest/meta-data/instance-id") +INSTANCE_ID=$(get_instance_id) [ $? -ne 0 ] && exit $OCF_ERR_GENERIC -MAC_ADDRESS=$(curl_retry "$OCF_RESKEY_curl_retries" "$OCF_RESKEY_curl_sleep" "--show-error -s -H 'X-aws-ec2-metadata-token: $TOKEN'" "http://169.254.169.254/latest/meta-data/mac") +MAC_ADDRESS=$(get_interface_mac) [ $? -ne 0 ] && exit $OCF_ERR_GENERIC NETWORK_ID=$(curl_retry "$OCF_RESKEY_curl_retries" "$OCF_RESKEY_curl_sleep" "--show-error -s -H 'X-aws-ec2-metadata-token: $TOKEN'" "http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MAC_ADDRESS}/interface-id") [ $? -ne 0 ] && exit $OCF_ERR_GENERIC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/docker new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/docker --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/docker 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/docker 2025-01-28 09:10:22.000000000 +0100 @@ -512,7 +512,7 @@ # - image # - repository:port/image # - docker.io/image (some distro will display "docker.io/" as prefix) - docker images | awk '{print $1 ":" $2}' | egrep -q -s "^(docker.io\/|${SERVER_NAME}\/)?${IMAGE_NAME}:${IMAGE_TAG}\$" + docker images | awk '{print $1 ":" $2}' | $EGREP -q -s "^(docker.io\/|${SERVER_NAME}\/)?${IMAGE_NAME}:${IMAGE_TAG}\$" if [ $? -eq 0 ]; then # image found return 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/eDir88.in new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/eDir88.in --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/eDir88.in 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/eDir88.in 2025-01-28 09:10:22.000000000 +0100 @@ -331,7 +331,7 @@ # Monitor IDM first, as it will start before LDAP if [ $MONITOR_IDM -eq 1 ]; then - RET=$($NDSTRACE --config-file "$NDSCONF" -c modules | egrep -i '^vrdim.*Running' | awk '{print $1}') + RET=$($NDSTRACE --config-file "$NDSCONF" -c modules | $EGREP -i '^vrdim.*Running' | awk '{print $1}') if [ "$RET" != "vrdim" ]; then ocf_log err "eDirectory IDM engine isn't running ($NDSCONF)." return $OCF_ERR_GENERIC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/ibm-cloud-vpc-cr-vip.in new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/ibm-cloud-vpc-cr-vip.in --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/ibm-cloud-vpc-cr-vip.in 1970-01-01 01:00:00.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/ibm-cloud-vpc-cr-vip.in 2025-01-28 09:10:22.000000000 +0100 @@ -0,0 +1,246 @@ +#!@PYTHON@ -tt +# ------------------------------------------------------------------------ +# Description: Resource Agent to move a IBM Cloud VIP based on Custom Route +# Next-hop Change from one virtual network interface (VNI) to +# the Second virtual network interface (VNI) +# +# Authors: Eran Gampel +# +# Copyright (c) 2024 International Business Machines, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ------------------------------------------------------------------------ +import subprocess +import ipaddress +import os +import sys +import textwrap +import time + +OCF_FUNCTIONS_DIR = os.environ.get( + "OCF_FUNCTIONS_DIR", "%s/lib/heartbeat" % os.environ.get("OCF_ROOT") +) + +sys.path.append(OCF_FUNCTIONS_DIR) + +RETRY_COUNT = 1 +SLEEP_TIME = 1 + +try: + import ocf +except ImportError: + sys.stderr.write("ImportError: ocf module import failed.") + sys.exit(5) + +try: + import ibm_cloud_fail_over +except ImportError: + ocf.logger.error("ImportError: import of ibm_cloud_fail_over module failed." \ + "install using: pip install ibm_cloud_fail_over") + pass + +def os_ip(ip): + """Check if VSI own this IP address.""" + + command = ["ip", "a"] + response = subprocess.run(command, capture_output=True, text=True) + return ip in response.stdout + +def ip_address_validator(ip): + """validate ip address string + + Args: + ip (string): ip address + + Returns: + bool: true if the strig is a valid ipv4 ip address + """ + try: + ipaddress.ip_address(ip) + return True + except ValueError: + return False + +def validate_all_action( + vpc_url="", + ext_ip_1="", + ext_ip_2="", + api_key="", +): + """validate all paramters + + Args: + vpc_url (str, mandatory): vpc_url for the region. + ext_ip_1 (str, mandatory): First Instance IP. + ext_ip_2 (str, mandatory): Second Instance IP. + api_key (str, optional): IBM Cloud API access key. Defaults to "". + + Returns: + _type_: _description_ + """ + if not ip_address_validator(ext_ip_1): + return ocf.OCF_ERR_CONFIGURED + if not ip_address_validator(ext_ip_2): + return ocf.OCF_ERR_CONFIGURED + ocf.logger.debug(f"validate_all_action: {vpc_url} {api_key}") + return ocf.OCF_SUCCESS + +def stop_action( + vpc_url="", + ext_ip_1="", + ext_ip_2="", + api_key="", +): + """Stop VIP + + Args: + vpc_url (str, mandatory): vpc_url for the region. + ext_ip_1 (str, mandatory): First Instance IP. + ext_ip_2 (str, mandatory): Second Instance IP. + api_key (str, optional): IBM Cloud API access key. Defaults to "". + + Returns: + _type_: _description_ + """ + ocf.logger.info("stop_action: stopping") + res = monitor_action(vpc_url, ext_ip_1, ext_ip_2, api_key) + if res == ocf.OCF_NOT_RUNNING: + ocf.logger.info("Resource is already stopped") + if res == ocf.OCF_SUCCESS: + for i in range(0,RETRY_COUNT): + time.sleep(SLEEP_TIME) + res = monitor_action(vpc_url, ext_ip_1, ext_ip_2, api_key) + if res == ocf.OCF_NOT_RUNNING: + break + return ocf.OCF_SUCCESS + +def start_action( + vpc_url="", + ext_ip_1="", + ext_ip_2="", + api_key="", +): + """start_action: redirect the service ip. + Args: + vpc_url (str, mandatory): vpc_url for the region . + ext_ip_1 (str, mandatory): First Instance IP. + ext_ip_2 (str, mandatory): Second Instance IP. + api_key (str, optional): IBM Cloud API access key. Defaults to "". + + Change custom route nexthop to point to this endpoint. + In case of a cross AZ Active Passive the route advertize zone will + be changed to the new active zone + """ + try: + ibm_cloud_fail_over.fail_over_cr_vip("SET", vpc_url , ext_ip_1, + ext_ip_2, api_key) + active_ip = ibm_cloud_fail_over.fail_over_cr_vip("GET", vpc_url , + ext_ip_1, ext_ip_2, api_key) + ocf.logger.info(f"start_action: active_ip: {active_ip}") + except Exception as e: + ocf.logger.error('Couldn\'t connect with IBM Cloud api: ' + str(e)) + sys.exit(ocf.OCF_ERR_GENERIC) + + return ocf.OCF_SUCCESS + +def monitor_action( + vpc_url="", + ext_ip_1="", + ext_ip_2="", + api_key="", +): + """monitor_action: check if service ip and gateway are responding.""" + + ocf.logger.debug("monitor_action:") + try: + active_ip = ibm_cloud_fail_over.fail_over_cr_vip("GET", vpc_url , ext_ip_1, + ext_ip_2, api_key) + if ip_address_validator(active_ip): + if os_ip(active_ip): + return ocf.OCF_SUCCESS + return ocf.OCF_NOT_RUNNING + except Exception as e: + ocf.logger.error('Couldn\'t connect with IBM Cloud api: ' + str(e)) + sys.exit(ocf.OCF_ERR_GENERIC) + + +def main(): + """Instantiate the resource agent.""" + + agent_description = textwrap.dedent("""\ + Resource Agent to move a IBM Cloud VIP based on Custom Route + from one virtual network interface (VNI) to another. + The prerequisites for the use of this resource agent are as follows: + + 1. A two-node (VSI or BM) cluster distributed in same Avilability zone or across. + 2. Enable Instance Metadata enabled on the two nodes + 3. allow_ip_spoofing enabled on the Virtual network interface + 3. IBM Cloud API Key or Trused profile: + """) + + agent = ocf.Agent( + "ibm-cloud-vpc-cr-vip", + shortdesc="Manages moving an IBM Cloud VIP based on Custom Route", + longdesc=agent_description + ) + + + agent.add_parameter( + "vpc_url", + shortdesc="VPC_URL", + longdesc="IBM Cloud Public VPC URL for your region or a VPE URL for IBM Cloud VPC", + content_type="string", + required=True, + ) + + agent.add_parameter( + "ext_ip_1", + shortdesc="Ip address for first instance.", + longdesc="predefined private ip address for first instance.", + content_type="string", + required=True, + ) + + agent.add_parameter( + "ext_ip_2", + shortdesc="Ip address for second instance.", + longdesc="predefined private ip address for second instance.", + content_type="string", + required=True, + ) + + + agent.add_parameter( + "api_key", + shortdesc="API Key or @API_KEY_FILE_PATH", + longdesc=( + "API Key or @API_KEY_FILE_PATH for IBM Cloud access. " + "The API key content or the path of an API key file that is indicated by the @ symbol." + "Not needed if trusted profile is used" + ), + content_type="string", + required=False, + ) + + + agent.add_action("start", timeout=30, handler=start_action) + agent.add_action("stop", timeout=30, handler=stop_action) + agent.add_action( + "monitor", depth=0, timeout=60, interval=60, handler=monitor_action + ) + agent.add_action("validate-all", timeout=30, handler=validate_all_action) + agent.run() + + +if __name__ == "__main__": + main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/ibm-cloud-vpc-move-fip.in new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/ibm-cloud-vpc-move-fip.in --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/ibm-cloud-vpc-move-fip.in 1970-01-01 01:00:00.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/ibm-cloud-vpc-move-fip.in 2025-01-28 09:10:22.000000000 +0100 @@ -0,0 +1,249 @@ +#!@PYTHON@ -tt +# ------------------------------------------------------------------------ +# Description: Resource Agent to move an IBM Cloud Floating IP (FIP) +# From one Virtual network Interface to another +# +# Authors: Eran Gampel +# +# Copyright (c) 2025 International Business Machines, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ------------------------------------------------------------------------ +import subprocess +import ipaddress +import os +import sys +import textwrap + +OCF_FUNCTIONS_DIR = os.environ.get( + "OCF_FUNCTIONS_DIR", "%s/lib/heartbeat" % os.environ.get("OCF_ROOT") +) + +sys.path.append(OCF_FUNCTIONS_DIR) + + +try: + import ocf +except ImportError: + sys.stderr.write("ImportError: ocf module import failed.") + sys.exit(5) + +try: + import ibm_cloud_fail_over +except ImportError: + ocf.logger.error("ImportError: import of ibm_cloud_fail_over module failed." \ + "install using: pip install ibm_cloud_fail_over") + pass + +def os_ip(ip): + """Check if VSI own this IP address.""" + + command = ["ip", "a"] + response = subprocess.run(command, capture_output=True, text=True, check=False) + return ip in response.stdout + +def ip_address_validator(ip): + """validate ip address string + + Args: + ip (string): ip address + + Returns: + bool: true if the strig is a valid ipv4 ip address + """ + try: + ipaddress.ip_address(ip) + return True + except ValueError: + return False + +def validate_all_action( + vpc_url="", + vni_id_1="", + vni_id_2="", + api_key="", +): + """validate all paramters + + Args: + vpc_url (str, mandatory): vpc_url for the region . + vni_id_1 (str, mandatory): First VNI(Virtual Network Interface) ID. + vni_id_2 (str, mandatory): Second VNI(Virtual Network Interface) ID. + api_key (str, optional): IBM Cloud API Access key. Defaults to "". + + Returns: + _type_: _description_ + """ + if not ip_address_validator(vni_id_1): + return ocf.OCF_ERR_CONFIGURED + if not ip_address_validator(vni_id_2): + return ocf.OCF_ERR_CONFIGURED + ocf.logger.debug(f"validate_all_action: {vpc_url} {api_key}") + return ocf.OCF_SUCCESS + +def stop_action( + vpc_url="", + vni_id_1="", + vni_id_2="", + fip_id="", + api_key="", +): + """Stop VIP + + Args: + vpc_url (str, mandatory): vpc_url for the region . + vni_id_1 (str, mandatory): First VNI(Virtual Network Interface) ID. + vni_id_2 (str, mandatory): Second VNI(Virtual Network Interface) ID. + api_key (str, optional): IBM Cloud API Access key. Defaults to "". + + Returns: + _type_: _description_ + """ + res = monitor_action(vpc_url, vni_id_1, vni_id_2, api_key) + if res == ocf.OCF_NOT_RUNNING: + ocf.logger.info("Resource is already stopped") + return ocf.OCF_SUCCESS + try: + ocf.logger.info("stop_action:stoping") + ibm_cloud_fail_over.fail_over_floating_ip_stop(vpc_url , vni_id_1, + vni_id_2, fip_id, api_key) + except Exception as e: + ocf.logger.error('stop_action: Couldn\'t connect with IBM Cloud api: ' + str(e)) + sys.exit(ocf.OCF_ERR_GENERIC) + return ocf.OCF_SUCCESS + +def start_action( + vpc_url="", + vni_id_1="", + vni_id_2="", + fip_id="", + api_key="", +): + """start_action: redirect the service ip. + Args: + vpc_url (str, mandatory): vpc_url for the region . + vni_id_1 (str, mandatory): First VNI(Virtual Network Interface) ID. + vni_id_2 (str, mandatory): Second VNI(Virtual Network Interface) ID. + api_key (str, optional): IBM Cloud API Access key. Defaults to "". + + Change custom route nexthop to point to this endpoint. + In case of a cross AZ Active Passive the route adveritise zone will + be chaged to the new acrtive zone + """ + try: + active_fip_id , active_fip_ip = ibm_cloud_fail_over.fail_over_floating_ip_start(vpc_url, + vni_id_1, vni_id_2, fip_id, api_key) + except Exception as e: + ocf.logger.error('start_action: Couldn\'t connect with IBM Cloud api: ' + str(e)) + sys.exit(ocf.OCF_ERR_GENERIC) + if active_fip_id != fip_id: + ocf.logger.error(f'start_action: fip_id: {fip_id} is not attached') + return ocf.OCF_ERR_GENERIC + ocf.logger.info(f'start_action: OCF_SUCCESS FIP IP: {active_fip_ip} is active') + return ocf.OCF_SUCCESS + +def monitor_action( + vpc_url="", + vni_id_1="", + vni_id_2="", + fip_id="", + api_key="", +): + """monitor_action: check if service ip and gateway are responding.""" + ocf.logger.debug(f'monitor_action: url: {vpc_url} fip_id: {fip_id}' \ + f'{vni_id_1} "vni_id_2:" {vni_id_2}') + try: + active_fip_id , active_fip_ip = ibm_cloud_fail_over.fail_over_get_attached_fip(api_key) + if active_fip_id == fip_id: + ocf.logger.debug(f'monitor_action: active fip ip: {active_fip_ip}') + return ocf.OCF_SUCCESS + return ocf.OCF_NOT_RUNNING + except Exception as e: + ocf.logger.error('Couldn\'t connect with IBM Cloud api: ' + str(e)) + sys.exit(ocf.OCF_ERR_GENERIC) + + +def main(): + """Instantiate the resource agent.""" + + agent_description = textwrap.dedent("""\ + Resource Agent to move an IBM Cloud Public Floating IP (FIP) from one virtual network + interface (VNI) to another. + The prerequisites for the use of this resource agent are as follows: + + 1. A two-node (VSI or BM) cluster distributed in same Availability Zone. + 2. Enable Instance Metadata on the two nodes. + 3. Use IBM Cloud API Key or Trusted Profile. + 4. Assign a Floating IP to one VNI. + """) + + agent = ocf.Agent( + "ibm-cloud-vpc-move-fip", + shortdesc="Manages moving an IBM Cloud Public FIP IP", + longdesc=agent_description + ) + + + agent.add_parameter( + "vpc_url", + shortdesc="VPC_URL", + longdesc="IBM Cloud Public VPC URL for your region or a VPE URL for IBM Cloud VPC", + content_type="string", + required=True, + ) + + agent.add_parameter( + "vni_id_1", + shortdesc="IBM Cloud Virtual Network Interface UUID for first instance", + longdesc="IBM Cloud Virtual Network Interface UUID (VNI) for first instance.", + content_type="string", + required=True, + ) + + agent.add_parameter( + "vni_id_2", + shortdesc="IBM Cloud Virtual Network Interface UUID for Second instance", + longdesc="IBM Cloud Virtual Network Interface UUID (VNI) for Second instance.", + content_type="string", + required=True, + ) + + agent.add_parameter( + "fip_id", + shortdesc="IBM Cloud Floating IP (FIP) UUID to be used for internet (public) traffic", + longdesc="IBM Cloud Floating IP (FIP) UUID to be used for internet (public) traffic.", + content_type="string", + required=True, + ) + + agent.add_parameter( + "api_key", + shortdesc="API Key", + longdesc=( + "API Key for IBM Cloud Access." + "Not needed if Trusted Profile is used" + ), + content_type="string", + required=False, + ) + + agent.add_action("start", timeout=30, handler=start_action) + agent.add_action("stop", timeout=30, handler=stop_action) + agent.add_action( + "monitor", depth=0, timeout=60, interval=60, handler=monitor_action + ) + agent.add_action("validate-all", timeout=60, handler=validate_all_action) + agent.run() + +if __name__ == "__main__": + main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/mysql-proxy new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/mysql-proxy --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/mysql-proxy 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/mysql-proxy 2025-01-28 09:10:22.000000000 +0100 @@ -572,7 +572,7 @@ fi # check for valid log-level - echo $log_level | egrep -q "^(error|warning|info|message|debug|)$" + echo $log_level | $EGREP -q "^(error|warning|info|message|debug|)$" if [ $? -ne 0 ]; then ocf_log err "MySQL Proxy log level '$log_level' not in valid range error|warning|info|message|debug" return $OCF_ERR_CONFIGURED diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/nfsserver new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/nfsserver --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/nfsserver 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/nfsserver 2025-01-28 09:10:22.000000000 +0100 @@ -264,7 +264,7 @@ ## # If the user defined an init script, It must exist for us to continue ## - if [ -n "$OCF_RESKEY_nfs_init_script" ]; then + if ! $systemd_is_running && [ -n "$OCF_RESKEY_nfs_init_script" ]; then # check_binary will exit the process if init script does not exist check_binary ${OCF_RESKEY_nfs_init_script} EXEC_MODE=1 @@ -274,7 +274,7 @@ ## # Check to see if the default init script exists, if so we'll use that. ## - if which $DEFAULT_INIT_SCRIPT > /dev/null 2>&1; then + if ! $systemd_is_running && which $DEFAULT_INIT_SCRIPT > /dev/null 2>&1; then OCF_RESKEY_nfs_init_script=$DEFAULT_INIT_SCRIPT EXEC_MODE=1 return 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/ocf-binaries.in new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/ocf-binaries.in --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/ocf-binaries.in 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/ocf-binaries.in 2025-01-28 09:10:22.000000000 +0100 @@ -9,6 +9,7 @@ # Binaries and binary options for use in Resource Agents : ${AWK:=@AWK@} : ${EGREP:="@EGREP@"} +: ${FGREP:="@FGREP@"} : ${IFCONFIG_A_OPT:="@IFCONFIG_A_OPT@"} : ${MAILCMD:=@MAILCMD@} : ${PING:=@PING@} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/ocf-shellfuncs.in new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/ocf-shellfuncs.in --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/ocf-shellfuncs.in 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/ocf-shellfuncs.in 2025-01-28 09:10:22.000000000 +0100 @@ -697,6 +697,15 @@ ocf_log debug "result: $result" [ $rc -eq 0 ] && break + if [ -n "$TOKEN" ] && [ -n "$TOKEN_FILE" ] && \ + [ -f "$TOKEN_FILE" ] && [ -n "$TOKEN_FUNC" ] && \ + echo "$result" | grep -q "The requested URL returned error: 401$"; then + local OLD_TOKEN="$TOKEN" + ocf_log err "Token invalid. Getting new token." + TOKEN=$($TOKEN_FUNC) + [ $? -ne 0 ] && exit $OCF_ERR_GENERIC + args=$(echo "$args" | sed "s/$OLD_TOKEN/$TOKEN/") + fi sleep $sleep done @@ -733,7 +742,7 @@ # The subshell prevents parsing error with incompatible shells ocf_version_cmp "$OCF_RESKEY_crm_feature_set" "3.19.7" if [ $res -eq 2 ] || [ $res -eq 1 ]; then - "$SHELL" -c "CIB_file=<(${HA_SBIN_DIR}/cibadmin -Q \ + "$SHELL" -c "CIB_file=<(${HA_SBIN_DIR}/cibadmin -Q) \ ${HA_SBIN_DIR}/crm_mon \$*" -- $* else "$SHELL" -c "CIB_file=<(${HA_SBIN_DIR}/cibadmin -Q | sed 's/validate-with=\"[^\"]*\"/validate-with=\"none\"/') \ @@ -1110,4 +1119,4 @@ # pacemaker sets HA_use_logd, some others use HA_LOGD :/ if ocf_is_true "$HA_use_logd"; then : ${HA_LOGD:=yes} -fi \ No newline at end of file +fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/openstack-cinder-volume new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/openstack-cinder-volume --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/openstack-cinder-volume 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/openstack-cinder-volume 2025-01-28 09:10:22.000000000 +0100 @@ -141,22 +141,24 @@ node_id=$(_get_node_id) - if [ "$__OCF_ACTION" = "monitor" ] && ocf_is_true $OCF_RESKEY_volume_local_check ; then - # - # Is the volue attached? - # We check the local devices - # - short_volume_id=$(echo $OCF_RESKEY_volume_id | awk '{print substr($0, 0, 20)}') - if lsblk /dev/disk/by-id/virtio-$short_volume_id 1>/dev/null 2>&1; then - return $OCF_SUCCESS - else - ocf_log warn "$OCF_RESKEY_volume_id is not attached to instance $node_id" - return $OCF_NOT_RUNNING + if ocf_is_true $OCF_RESKEY_volume_local_check ; then + if [ "$__OCF_ACTION" = "monitor" ] || [ "$1" = "quick" ]; then + # + # Is the volume attached? + # We check the local devices + # + short_volume_id=$(echo $OCF_RESKEY_volume_id | awk '{print substr($0, 0, 20)}') + if lsblk /dev/disk/by-id/virtio-$short_volume_id 1>/dev/null 2>&1; then + return $OCF_SUCCESS + else + ocf_log warn "$OCF_RESKEY_volume_id is not attached to instance $node_id" + return $OCF_NOT_RUNNING + fi fi fi # - # Is the volue attached? + # Is the volume attached? # We use the API # result=$(run_openstackcli "volume show \ @@ -247,6 +249,11 @@ return $OCF_ERR_GENERIC fi + while ! osvol_monitor quick; do + ocf_log info "Waiting for cinder volume $OCF_RESKEY_volume_id to appear on $node_id" + sleep 1 + done + return $OCF_SUCCESS } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/portblock new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/portblock --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/portblock 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/portblock 2025-01-28 09:10:22.000000000 +0100 @@ -529,7 +529,7 @@ CheckPort() { # Examples of valid port: "1080", "1", "0080" # Examples of invalid port: "1080bad", "0", "0000", "" - echo $1 |egrep -qx '[0-9]+(:[0-9]+)?(,[0-9]+(:[0-9]+)?)*' + echo $1 | $EGREP -qx '[0-9]+(:[0-9]+)?(,[0-9]+(:[0-9]+)?)*' } IptablesValidateAll() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/rabbitmq-server-ha new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/rabbitmq-server-ha --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/rabbitmq-server-ha 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/rabbitmq-server-ha 2025-01-28 09:10:22.000000000 +0100 @@ -529,7 +529,7 @@ pid="none" else # check if provide just a number - echo "${pid_param}" | egrep -q '^[0-9]+$' + echo "${pid_param}" | $EGREP -q '^[0-9]+$' if [ $? -eq 0 ]; then pid="${pid_param}" elif [ -e "${pid_param}" ]; then # check if passed in a pid file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/sapdb.sh new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/sapdb.sh --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/sapdb.sh 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/sapdb.sh 2025-01-28 09:10:22.000000000 +0100 @@ -238,7 +238,7 @@ esac SEARCH=`echo "$OCF_RESKEY_MONITOR_SERVICES" | sed 's/\+/\\\+/g' | sed 's/\./\\\./g'` - if [ `echo "$SERVICE" | egrep -c "$SEARCH"` -eq 1 ] + if [ `echo "$SERVICE" | $EGREP -c "$SEARCH"` -eq 1 ] then if [ $STATE -eq $OCF_NOT_RUNNING ] then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/smb-share.in new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/smb-share.in --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/smb-share.in 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/smb-share.in 2025-01-28 09:10:22.000000000 +0100 @@ -435,7 +435,7 @@ smb_share_monitor() { RES=$(smbcontrol smbd ping > /dev/null 2>&1) if [ $? -eq 0 ];then - if [ $(testparm -s 2>/dev/null| egrep -c \\[$OCF_RESKEY_share\\]) -eq 1 ];then + if [ $(testparm -s 2>/dev/null| $EGREP -c \\[$OCF_RESKEY_share\\]) -eq 1 ];then return $OCF_SUCCESS else return $OCF_NOT_RUNNING @@ -449,7 +449,7 @@ smb_share_checktmpmount RES=$(smbcontrol smbd ping > /dev/null 2>&1) if [ $? -eq 0 ];then - if [ $(testparm -s 2>/dev/null| egrep -c \\[$OCF_RESKEY_share\\]) -eq 1 ];then + if [ $(testparm -s 2>/dev/null| $EGREP -c \\[$OCF_RESKEY_share\\]) -eq 1 ];then ocf_log info "Samba share $OCF_RESKEY_share is active" return $OCF_SUCCESS else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/storage-mon.in new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/storage-mon.in --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/storage-mon.in 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/storage-mon.in 2025-01-28 09:10:22.000000000 +0100 @@ -152,7 +152,7 @@ ####################################################################### -storage-mon_usage() { +storage_mon_usage() { cat <<END usage: $0 {start|stop|monitor|validate-all|meta-data} @@ -161,7 +161,7 @@ return $1 } -storage-mon_init() { +storage_mon_init() { #Test for presence of storage_mon helper if [ ! -x "$STORAGEMON" ] ; then ocf_log err "${STORAGEMON} not installed." @@ -205,7 +205,7 @@ fi } -storage-mon_update_attribute() { +storage_mon_update_attribute() { while : do @@ -224,9 +224,9 @@ return $OCF_SUCCESS } -storage-mon_monitor() { +storage_mon_monitor() { if ! ocf_is_true "$OCF_RESKEY_daemonize"; then - storage-mon_init + storage_mon_init # Monitor _MUST!_ differentiate correctly between running # (SUCCESS), failed (ERROR) or _cleanly_ stopped (NOT RUNNING). @@ -252,7 +252,7 @@ status="green" fi - storage-mon_update_attribute $status + storage_mon_update_attribute $status return "$?" else ocf_pidfile_status "${PIDFILE}" > /dev/null 2>&1 @@ -298,20 +298,25 @@ esac done - storage-mon_update_attribute $status + storage_mon_update_attribute $status return "$?" fi } -storage-mon_start() { +storage_mon_start() { if ! ocf_is_true "$OCF_RESKEY_daemonize"; then - storage-mon_monitor + storage_mon_monitor if [ $? -eq $OCF_SUCCESS ]; then return $OCF_SUCCESS fi touch "${OCF_RESKEY_state_file}" else - storage-mon_init + storage_mon_monitor pid_check_only + if [ $? -eq $OCF_SUCCESS ]; then + ocf_log info "storage_mon is already running. PID=`cat $PIDFILE`" + return $OCF_SUCCESS + fi + storage_mon_init # generate command line cmdline="" for DRIVE in ${OCF_RESKEY_drives}; do @@ -325,11 +330,22 @@ if [ "$?" -ne 0 ]; then return $OCF_ERR_GENERIC fi + + #Wait until monitor confirms the startup pid according to the ocf resource specification. + while true; do + storage_mon_monitor pid_check_only + rc="$?" + if [ $rc -eq $OCF_SUCCESS ]; then + break + fi + sleep 1 + ocf_log debug "storage-mon daemon still hasn't started yet. Waiting..." + done fi } -storage-mon_stop() { - storage-mon_monitor +storage_mon_stop() { + storage_mon_monitor rc=$? if ! ocf_is_true "$OCF_RESKEY_daemonize"; then @@ -352,7 +368,7 @@ fi while true; do - storage-mon_monitor pid_check_only + storage_mon_monitor pid_check_only rc="$?" case "$rc" in $OCF_SUCCESS) @@ -368,8 +384,8 @@ return $OCF_SUCCESS } -storage-mon_validate() { - storage-mon_init +storage_mon_validate() { + storage_mon_init if ! ocf_is_true "$OCF_RESKEY_daemonize"; then # Is the state directory writable? @@ -385,13 +401,13 @@ } case "$__OCF_ACTION" in - start) storage-mon_start;; - stop) storage-mon_stop;; - monitor) storage-mon_monitor;; - validate-all) storage-mon_validate;; + start) storage_mon_start;; + stop) storage_mon_stop;; + monitor) storage_mon_monitor;; + validate-all) storage_mon_validate;; meta-data) meta_data;; - usage|help) storage-mon_usage $OCF_SUCCESS;; - *) storage-mon_usage $OCF_ERR_UNIMPLEMENTED;; + usage|help) storage_mon_usage $OCF_SUCCESS;; + *) storage_mon_usage $OCF_ERR_UNIMPLEMENTED;; esac rc=$? ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/heartbeat/symlink new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/symlink --- old/resource-agents-4.16.0+git2.20a433c3/heartbeat/symlink 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/heartbeat/symlink 2025-01-28 09:10:22.000000000 +0100 @@ -123,7 +123,7 @@ ocf_log debug "$OCF_RESKEY_link exists but is not a symbolic link, will be moved to ${OCF_RESKEY_link}${OCF_RESKEY_backup_suffix} on start" rc=$OCF_NOT_RUNNING fi - elif readlink -m "$OCF_RESKEY_link" | egrep -q "^$(readlink -m ${OCF_RESKEY_target})$"; then + elif readlink -m "$OCF_RESKEY_link" | $EGREP -q "^$(readlink -m ${OCF_RESKEY_target})$"; then ocf_log debug "$OCF_RESKEY_link exists and is a symbolic link to ${OCF_RESKEY_target}." rc=$OCF_SUCCESS else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/resource-agents.spec.in new/resource-agents-4.16.0+git38.da9ef4e2/resource-agents.spec.in --- old/resource-agents-4.16.0+git2.20a433c3/resource-agents.spec.in 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/resource-agents.spec.in 2025-01-28 09:10:22.000000000 +0100 @@ -100,14 +100,14 @@ %endif # Filesystem / fs.sh / netfs.sh -%if 0%{?fedora} > 39 || 0%{?suse_version} +%if 0%{?fedora} > 39 || 0%{?rhel} > 9 || 0%{?suse_version} Requires: /usr/sbin/fsck %else Requires: /sbin/fsck %endif Requires: /usr/sbin/fsck.ext2 /usr/sbin/fsck.ext3 /usr/sbin/fsck.ext4 Requires: /usr/sbin/fsck.xfs -%if 0%{?fedora} > 40 || 0%{?suse_version} +%if 0%{?fedora} > 40 || 0%{?rhel} > 9 || 0%{?suse_version} Requires: /usr/sbin/mount.nfs /usr/sbin/mount.nfs4 %else Requires: /sbin/mount.nfs /sbin/mount.nfs4 @@ -127,7 +127,7 @@ Requires: /usr/sbin/lvm # nfsserver / netfs.sh -%if 0%{?fedora} > 40 || 0%{?suse_version} +%if 0%{?fedora} > 40 || 0%{?rhel} > 9 || 0%{?suse_version} Requires: /usr/sbin/rpc.statd %else Requires: /sbin/rpc.statd @@ -141,7 +141,7 @@ Requires: /sbin/rdisc /usr/sbin/arping /bin/ping /bin/ping6 # nfsexport.sh -%if 0%{?fedora} > 39 +%if 0%{?fedora} > 39 || 0%{?rhel} > 9 Requires: /usr/sbin/findfs Requires: /usr/sbin/quotaon /usr/sbin/quotacheck %else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-4.16.0+git2.20a433c3/tools/storage_mon.c new/resource-agents-4.16.0+git38.da9ef4e2/tools/storage_mon.c --- old/resource-agents-4.16.0+git2.20a433c3/tools/storage_mon.c 2024-11-12 09:00:46.000000000 +0100 +++ new/resource-agents-4.16.0+git38.da9ef4e2/tools/storage_mon.c 2025-01-28 09:10:22.000000000 +0100 @@ -320,7 +320,14 @@ finished_count++; test_forks[index] = 0; - + + /* Update the result value for the client response once all checks have completed. */ + if (device_count == finished_count) { + response_final_score = final_score; + if (!daemon_check_first_all_devices) { + daemon_check_first_all_devices = TRUE; + } + } } } } else { @@ -441,15 +448,7 @@ if (is_child_runnning()) { device_check = FALSE; } - - if (device_count == finished_count && device_check) { - /* Update the result value for the client response once all checks have completed. */ - response_final_score = final_score; - if (!daemon_check_first_all_devices) { - daemon_check_first_all_devices = TRUE; - } - } } if (device_check) { ++++++ use-python-311.patch ++++++ --- /var/tmp/diff_new_pack.MKT7aH/_old 2025-01-29 16:09:43.833853077 +0100 +++ /var/tmp/diff_new_pack.MKT7aH/_new 2025-01-29 16:09:43.837853243 +0100 @@ -1,5 +1,5 @@ ---- resource-agents/configure.ac-orig 2024-07-31 09:21:33.479621551 +0200 -+++ resource-agents/configure.ac 2024-07-31 09:21:58.027818044 +0200 +--- resource-agents-4.16.0+git38.da9ef4e2/configure.ac.orig 2025-01-28 18:29:13.312397138 +0100 ++++ resource-agents-4.16.0+git38.da9ef4e2/configure.ac 2025-01-28 18:29:53.144814319 +0100 @@ -503,7 +503,7 @@ AC_SUBST(RM) AC_SUBST(TEST) @@ -9,9 +9,9 @@ if test -z "$PYTHON"; then echo "*** Essential program python not found" 1>&2 exit 1 -@@ -522,7 +522,7 @@ - AC_PYTHON_MODULE(requests) +@@ -523,7 +523,7 @@ AC_PYTHON_MODULE(urllib3) + AC_PYTHON_MODULE(ibm_cloud_fail_over) -AS_VERSION_COMPARE([$PYTHON_VERSION], [3.6], [BUILD_OCF_PY=0], [BUILD_OCF_PY=1], [BUILD_OCF_PY=1]) +AS_VERSION_COMPARE([$PYTHON_VERSION], [3.11], [BUILD_OCF_PY=0], [BUILD_OCF_PY=1], [BUILD_OCF_PY=1])