[Pkg-ganeti-devel] [ganeti] 01/10: Add master detection capability to molly-guard-helper

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Thu Apr 30 08:23:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository ganeti.

commit 0f493a9c92438113a3d58f09495749d81fbc792e
Author: Gregory Potamianos <greg.potamianos at gmail.com>
Date:   Thu Jan 22 14:20:38 2015 +0200

    Add master detection capability to molly-guard-helper
    
    Warn if the node being shutdown/rebooted is the master for
    this cluster
---
 debian/molly-guard-helper | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/debian/molly-guard-helper b/debian/molly-guard-helper
index b8a7d72..5ec27b0 100755
--- a/debian/molly-guard-helper
+++ b/debian/molly-guard-helper
@@ -71,12 +71,23 @@ def main():
             sys.stderr.write("W: unable to list %s instances: %s\n" %
                              (hv_type, str(err)))
 
-    if instances:
-        sys.stdout.write("W: The following Ganeti instances will be"
-                         " terminated abnormally if you %s this system:\n" %
-                         action)
-        for instance in sorted(instances):
-            sys.stdout.write("   - %s\n" % instance)
+    current_master = conf.GetMasterNode()
+
+    node_is_current_master = False
+    if hostname == current_master:
+        node_is_current_master = True
+
+    if instances or node_is_current_master:
+        if instances:
+            sys.stdout.write("W: The following Ganeti instances will be"
+                             " terminated abnormally if you %s this system:\n" %
+                             action)
+            for instance in sorted(instances):
+                sys.stdout.write("   - %s\n" % instance)
+
+        if node_is_current_master:
+            sys.stdout.write("W: This system is the current Ganeti master"
+                             " for this cluster\n")
 
         try:
             response = raw_input("Type YES to %s the system: " % action)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git



More information about the Pkg-ganeti-devel mailing list