Add a command to gnt-cluster to immediately forget a repair
event. Note that, if the event is still observed in the cluster
this observation will trigger a new repair event (with a new UUID).

Signed-off-by: Klaus Aehlig <[email protected]>
---
 lib/client/gnt_cluster.py | 19 +++++++++++++++++++
 man/gnt-cluster.rst       | 10 ++++++++++
 2 files changed, 29 insertions(+)

diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py
index 2add806..9eca4b3 100644
--- a/lib/client/gnt_cluster.py
+++ b/lib/client/gnt_cluster.py
@@ -58,6 +58,7 @@ from ganeti import ssconf
 from ganeti import ssh
 from ganeti import uidpool
 from ganeti import utils
+from ganeti import wconfd
 from ganeti.client import base
 
 
@@ -1909,6 +1910,21 @@ def Epo(opts, args, qcl=None, _on_fn=_EpoOn, 
_off_fn=_EpoOff,
     return _off_fn(opts, node_list, inst_map)
 
 
+def RemoveRepair(opts, args):
+  """Uncoditionally remove a repair event
+
+  @param opts: the command line options selected by the user (ignored)
+  @type args: list
+  @param args: one element, the uuid of the event to remove
+  @rtype: int
+  @return: the desired exit code
+
+  """
+  uuid = args[0]
+  wconfd.Client().RmMaintdIncident(uuid)
+  return 0
+
+
 def _GetCreateCommand(info):
   buf = StringIO()
   buf.write("gnt-cluster init")
@@ -2535,6 +2551,9 @@ commands = {
   "upgrade": (
     UpgradeGanetiCommand, ARGS_NONE, [TO_OPT, RESUME_OPT], "",
     "Upgrade (or downgrade) to a new Ganeti version"),
+  "remove-repair": (
+    RemoveRepair, [ArgUnknown()], [], "<uuid>",
+    "Remove a repair event from the list of pending events"),
   }
 
 
diff --git a/man/gnt-cluster.rst b/man/gnt-cluster.rst
index cd60f6e..4bcd5d9 100644
--- a/man/gnt-cluster.rst
+++ b/man/gnt-cluster.rst
@@ -851,6 +851,16 @@ configuration mismatches.
 See **ganeti**\(7) for a description of ``--submit`` and other common
 options.
 
+REMOVE-REPAIR
+~~~~~~~~~~~~~
+
+**renove-repair** *uuid*
+
+Unconditionally remove the specified repair event from the list of repair
+events tracked by the maintenance daemon. Note that if the node still reports
+the same breakage, a new event for this breakage will be created at next
+node querying by the daemon.
+
 RENAME
 ~~~~~~
 
-- 
2.5.0.rc2.392.g76e840b

Reply via email to