From d512e84b8ed38a830610b7f7f12b1b4c6d1c18d7 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Tue, 16 Mar 2010 14:51:38 +0100
Subject: [PATCH] =?UTF-8?q?Improve=20=E2=80=9Cgnt-cluster=20renew-crypto?=
 =?UTF-8?q?=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- Report exception text immediately instead of just logging it
- Remove leftover assertion from when it still used β€œgnt-cluster
  modify”

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/cli.py          | 4 +++-
 scripts/gnt-cluster | 3 ---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/cli.py b/lib/cli.py
index e4e0fe808..2e0a23c7e 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -1665,8 +1665,10 @@ class _RunWhileClusterStoppedHelper:
         # All daemons are shut down now
         try:
           return fn(self, *args)
-        except Exception:
+        except Exception, err:
+          _, errmsg = FormatError(err)
           logging.exception("Caught exception")
+          self.feedback_fn(errmsg)
           raise
       finally:
         # Start cluster again, master node last
diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster
index 1a58f11e6..50e68fe4f 100755
--- a/scripts/gnt-cluster
+++ b/scripts/gnt-cluster
@@ -510,9 +510,6 @@ def _RenewCrypto(new_cluster_cert, new_rapi_cert, rapi_cert_filename,
   @param force: Whether to ask user for confirmation
 
   """
-  assert (new_cluster_cert or new_rapi_cert or rapi_cert_filename or
-          new_confd_hmac_key)
-
   if new_rapi_cert and rapi_cert_filename:
     ToStderr("Only one of the --new-rapi-certficate and --rapi-certificate"
              " options can be specified at the same time.")
-- 
GitLab