Blame SOURCES/2.0-cleanup-behavior.patch

951ecb
From 612fcbb399cfaa558504eeaa6ab16064e9013238 Mon Sep 17 00:00:00 2001
951ecb
From: Ken Gaillot <kgaillot@redhat.com>
951ecb
Date: Tue, 7 Aug 2018 11:56:06 -0500
951ecb
Subject: [PATCH] Feature: tools: enable 2.0 behavior of crm_resource clean-up
951ecb
951ecb
---
413fc7
 tools/crm_resource.c | 49 +++++----------
413fc7
 1 file changed, 20 insertions(+), 29 deletions(-)
951ecb
951ecb
diff --git a/tools/crm_resource.c b/tools/crm_resource.c
413fc7
index 128d075..bbdba25 100644
951ecb
--- a/tools/crm_resource.c
951ecb
+++ b/tools/crm_resource.c
af918f
@@ -214,8 +214,6 @@ static struct crm_option long_options[] = {
951ecb
     },
951ecb
     {
951ecb
         "cleanup", no_argument, NULL, 'C',
951ecb
-#if 0
951ecb
-        // new behavior disabled until 2.0.0
951ecb
         "\t\tIf resource has any past failures, clear its history and fail count.\n"
951ecb
         "\t\t\t\tOptionally filtered by --resource, --node, --operation, and --interval (otherwise all).\n"
951ecb
         "\t\t\t\t--operation and --interval apply to fail counts, but entire history is always cleared,\n"
951ecb
@@ -221,7 +219,6 @@ static struct crm_option long_options[] = {
951ecb
     },
951ecb
     {
951ecb
         "refresh", no_argument, NULL, 'R',
951ecb
-#endif
951ecb
         "\t\tDelete resource's history (including failures) so its current state is rechecked.\n"
f0d7ba
         "\t\t\t\tOptionally filtered by --resource and --node (otherwise all). If the named resource is\n"
f0d7ba
         "\t\t\t\tpart of a group, or one numbered instance of a clone or bundled resource, the clean-up\n"
951ecb
@@ -352,13 +349,11 @@ static struct crm_option long_options[] = {
951ecb
     },
951ecb
     {
951ecb
         "operation", required_argument, NULL, 'n',
951ecb
-        "\tOperation to clear instead of all (with -C -r)",
951ecb
-        pcmk_option_hidden // only used with 2.0 -C behavior
951ecb
+        "\tOperation to clear instead of all (with -C -r)"
951ecb
     },
951ecb
     {
951ecb
         "interval", required_argument, NULL, 'I',
951ecb
-        "\tInterval of operation to clear (default 0) (with -C -r -n)",
951ecb
-        pcmk_option_hidden // only used with 2.0 -C behavior
951ecb
+        "\tInterval of operation to clear (default 0) (with -C -r -n)"
951ecb
     },
951ecb
     {
951ecb
         "set-name", required_argument, NULL, 's',
951ecb
@@ -388,7 +383,6 @@ static struct crm_option long_options[] = {
951ecb
     {"un-migrate", no_argument, NULL, 'U', NULL, pcmk_option_hidden},
951ecb
     {"un-move", no_argument, NULL, 'U', NULL, pcmk_option_hidden},
951ecb
 
951ecb
-    {"refresh",    0, 0, 'R', NULL, pcmk_option_hidden}, // remove this line for 2.0.0
951ecb
     {"reprobe", no_argument, NULL, 'P', NULL, pcmk_option_hidden},
951ecb
 
951ecb
     {"-spacer-", 1, NULL, '-', "\nExamples:", pcmk_option_paragraph},
951ecb
@@ -630,15 +624,16 @@ main(int argc, char **argv)
c54a00
                 require_resource = FALSE;
951ecb
                 break;
951ecb
 
951ecb
+            case 'P':
951ecb
+                flag = 'R';
951ecb
             case 'C':
951ecb
             case 'R':
951ecb
-            case 'P':
951ecb
                 crm_log_args(argc, argv);
951ecb
                 require_resource = FALSE;
951ecb
                 if (cib_file == NULL) {
951ecb
                     require_crmd = TRUE;
951ecb
                 }
951ecb
-                rsc_cmd = 'R'; // disable new behavior until 2.0
951ecb
+                rsc_cmd = flag;
951ecb
                 find_flags = pe_find_renamed|pe_find_anon;
951ecb
                 break;
951ecb
 
951ecb
-- 
951ecb
1.8.3.1
951ecb