[ClusterLabs] crmsh configure delete for constraints

Vladislav Bogdanov bubble at hoster-ok.com
Mon Feb 8 08:48:31 EST 2016


Hi,

when performing a delete operation, crmsh (2.2.0) having -F tries
to stop passed op arguments and then waits for DC to become idle.

That is not needed if only constraints are passed to delete.
Could that be changed? Or, could it wait only if there is something to stop?

Something like this:
diff --git a/modules/ui_configure.py b/modules/ui_configure.py
index cf98702..96ab77e 100644
--- a/modules/ui_configure.py
+++ b/modules/ui_configure.py
@@ -552,6 +552,9 @@ class CibConfig(command.UI):
             if not ok or not cib_factory.commit():
                 raise ValueError("Failed to stop one or more running resources: %s" %
                                  (', '.join(to_stop)))
+            return True
+        else:
+            return False
 
     @command.skill_level('administrator')
     @command.completers_repeating(_id_list)
@@ -562,8 +565,8 @@ class CibConfig(command.UI):
         arg_force = any((x in ('-f', '--force')) for x in argl)
         argl = [x for x in argl if (x not in ('-f', '--force'))]
         if arg_force or config.core.force:
-            self._stop_if_running(argl)
-            utils.wait4dc(what="Stopping %s" % (", ".join(argl)))
+            if (self._stop_if_running(argl)):
+                utils.wait4dc(what="Stopping %s" % (", ".join(argl)))
         return cib_factory.delete(*argl)
 
     @command.name('default-timeouts')


More, it may be worth checking stop-orphan-resources property and pass stop
work to pacemaker if it is set to true.


Thank you,
Vladislav




More information about the Users mailing list