!41 doc: writing-python-agents: add description of is_probe() and distro()

From: @xiangbudaomz 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
This commit is contained in:
openeuler-ci-bot 2024-04-25 12:43:28 +00:00 committed by Gitee
commit d1593f1164
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From db77cd138eede869b31ac71782be674d39a1377c Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Tue, 23 Apr 2024 13:15:06 +0200
Subject: [PATCH] doc: writing-python-agents: add description of is_probe() and
distro()
---
doc/dev-guides/writing-python-agents.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/doc/dev-guides/writing-python-agents.md b/doc/dev-guides/writing-python-agents.md
index 9bf89d09..1b05e23b 100644
--- a/doc/dev-guides/writing-python-agents.md
+++ b/doc/dev-guides/writing-python-agents.md
@@ -52,7 +52,11 @@ logger.error("Something went terribly wrong.")
* `ocf_exit_reason`: Prints the exit error string to stderr.
* `have_binary`: Returns True if the given binary is available.
* `is_true`: Converts an OCF truth value to a Python boolean.
+* `is_probe`: Returns True when running a probe action. Used to return
+ OCF_NOT_RUNNING instead of error code that would cause unexpected actions
+ like fencing before starting the resource or when it is disabled.
* `get_parameter`: Looks up the matching `OCF_RESKEY_` environment variable.
+* `distro`: Returns <Distro>/<Version> or <Distro> if version info is unavailable.
* `Agent`: Class which helps to generate the XML metadata.
* `run`: OCF run loop implementation.
--
2.25.1

View File

@ -1,7 +1,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.13.0 Version: 4.13.0
Release: 19 Release: 20
License: GPLv2+ and LGPLv2+ License: GPLv2+ and LGPLv2+
URL: https://github.com/ClusterLabs/resource-agents URL: https://github.com/ClusterLabs/resource-agents
Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz
@ -24,6 +24,7 @@ Patch0015: findifsh-fix-corner-cases.patch
Patch0016: fix-OCF_SUCESS-name-in-db2_notify.patch Patch0016: fix-OCF_SUCESS-name-in-db2_notify.patch
Patch0017: docs-writing-python-agents-update-required-Python-ve.patch Patch0017: docs-writing-python-agents-update-required-Python-ve.patch
Patch0018: galera-allow-joiner-to-report-non-Primary-during-ini.patch Patch0018: galera-allow-joiner-to-report-non-Primary-during-ini.patch
Patch0019: doc-writing-python-agents-add-description-of-is_prob.patch
Obsoletes: heartbeat-resources <= %{version} Obsoletes: heartbeat-resources <= %{version}
Provides: heartbeat-resources = %{version} Provides: heartbeat-resources = %{version}
BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel
@ -121,6 +122,9 @@ export CFLAGS="$(echo '%{optflags}')"
%{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*}
%changelog %changelog
* Thu Apr 25 2024 zouzhimin <zouzhimin@kylinos.cn> - 4.13.0-20
- doc: writing-python-agents: add description of is_probe() and distro()
* Tue Apr 22 2024 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-19 * Tue Apr 22 2024 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-19
- galera: allow joiner to report non-Primary during initial IST - galera: allow joiner to report non-Primary during initial IST