Blame SOURCES/2.0-cleanup-behavior.patch

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