From 781b2b2b3fd8e26069c274d9f02e3f6b2b2ebea8 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Wed, 10 Oct 2007 13:05:29 +0000
Subject: [PATCH] Exit ganeti-watcher cleanly when there's no configuration.

Reviewed-by: iustinp
---
 daemons/ganeti-watcher | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/daemons/ganeti-watcher b/daemons/ganeti-watcher
index c912592e9..b066a5516 100755
--- a/daemons/ganeti-watcher
+++ b/daemons/ganeti-watcher
@@ -457,7 +457,11 @@ def main():
     sys.stderr = sys.stdout = open(constants.LOG_WATCHER, 'a')
 
   try:
-    watcher = Watcher()
+    try:
+      watcher = Watcher()
+    except errors.ConfigurationError:
+      # Just exit if there's no configuration
+      sys.exit(constants.EXIT_SUCCESS)
     watcher.Run()
     watcher.WriteReport(sys.stdout)
   except NotMasterError:
-- 
GitLab