From e8ab7135f77f22ec494a202a66c7a5e9b74630d0 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Fri, 31 Jan 2025 10:06:04 -0500
Subject: [PATCH] Low: python: Add python value for new CRM_EX_NO_DC exit code.

---
 doc/sphinx/Pacemaker_Development/c.rst | 2 ++
 include/crm/common/results.h           | 5 ++++-
 python/pacemaker/exitstatus.py         | 3 ++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/doc/sphinx/Pacemaker_Development/c.rst b/doc/sphinx/Pacemaker_Development/c.rst
index bfdff64633..8d879617f1 100644
--- a/doc/sphinx/Pacemaker_Development/c.rst
+++ b/doc/sphinx/Pacemaker_Development/c.rst
@@ -850,6 +850,8 @@ messages and converting from one to another, can be found in
 
 * ``crm_exit_t`` (the ``CRM_EX_*`` enum values) is a system-independent code
   suitable for the exit status of a process, or for interchange between nodes.
+  These values need to be kept in sync with the ``ExitStatus`` enum in
+  ``python/pacemaker/exitstatus.py``.
 
 * Other special-purpose status codes exist, such as ``enum ocf_exitcode`` for
   the possible exit statuses of OCF resource agents (along with some
diff --git a/include/crm/common/results.h b/include/crm/common/results.h
index a671cb8efd..60a88ddbc0 100644
--- a/include/crm/common/results.h
+++ b/include/crm/common/results.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012-2024 the Pacemaker project contributors
+ * Copyright 2012-2025 the Pacemaker project contributors
  *
  * The version control history for this file may have further details.
  *
@@ -226,6 +226,9 @@ enum ocf_exitcode {
  * tldp.org recommends 64-113 for application use.
  *
  * We try to overlap with the above conventions when practical.
+ *
+ * NOTE: When new exit codes are added here, remember to also update
+ * python/pacemaker/exitstatus.py.
  */
 typedef enum crm_exit_e {
     // Common convention
diff --git a/python/pacemaker/exitstatus.py b/python/pacemaker/exitstatus.py
index 03f7d2c8e2..3f951ce465 100644
--- a/python/pacemaker/exitstatus.py
+++ b/python/pacemaker/exitstatus.py
@@ -1,7 +1,7 @@
 """A module providing constants relating to why a process or function exited."""
 
 __all__ = ["ExitStatus"]
-__copyright__ = "Copyright 2023-2024 the Pacemaker project contributors"
+__copyright__ = "Copyright 2023-2025 the Pacemaker project contributors"
 __license__ = "GNU Lesser General Public License version 2.1 or later (LGPLv2.1+)"
 
 from enum import IntEnum, unique
@@ -57,6 +57,7 @@ class ExitStatus(IntEnum):
     NOT_YET_IN_EFFECT = 111
     INDETERMINATE = 112
     UNSATISFIED = 113
+    NO_DC = 114
     TIMEOUT = 124
     DEGRADED = 190
     DEGRADED_PROMOTED = 191
-- 
2.43.0

