Expose verbose/debug option to renew-crypto
authorHelga Velroyen <helgav@google.com>
Wed, 16 Dec 2015 08:55:58 +0000 (09:55 +0100)
committerHelga Velroyen <helgav@google.com>
Thu, 7 Jan 2016 13:33:28 +0000 (14:33 +0100)
To be able to increase the log level of SSH update
tools easily, this patch propagates the debug/verbose
option to the client side.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

lib/client/gnt_cluster.py
lib/cmdlib/cluster/__init__.py
lib/rpc_defs.py
lib/server/noded.py

index 86b20f2..9833b33 100644 (file)
@@ -1202,7 +1202,9 @@ def _RenewCrypto(new_cluster_cert, new_rapi_cert, # pylint: disable=R0911
         node_certificates=new_node_cert or new_cluster_cert,
         renew_ssh_keys=new_ssh_keys,
         ssh_key_type=ssh_key_type,
-        ssh_key_bits=ssh_key_bits)
+        ssh_key_bits=ssh_key_bits,
+        verbose=verbose,
+        debug=debug)
     SubmitOpCode(renew_op, cl=cl)
 
   ToStdout("All requested certificates and keys have been replaced."
index 6d0ea55..74d109c 100644 (file)
@@ -191,7 +191,9 @@ class LUClusterRenewCrypto(NoHooksLU):
       potential_master_candidates,
       cluster_info.ssh_key_type, # Old key type
       self.ssh_key_type,         # New key type
-      self.ssh_key_bits)         # New key bits
+      self.ssh_key_bits,         # New key bits
+      self.op.debug,
+      self.op.verbose)
     result[master_uuid].Raise("Could not renew the SSH keys of all nodes")
 
     # After the keys have been successfully swapped, time to commit the change
index ede6830..39d5029 100644 (file)
@@ -568,7 +568,9 @@ _NODE_CALLS = [
     ("potential_master_candidates", None, "Potential master candidates"),
     ("old_key_type", None, "The type of key previously used"),
     ("new_key_type", None, "The type of key to generate"),
-    ("new_key_bits", None, "The length of the key to generate")],
+    ("new_key_bits", None, "The length of the key to generate"),
+    ("debug", None, "Set logging of SSH update tool to 'debug'."),
+    ("verbose", None, "Set logging of SSH update tool to 'info'.")],
     None, None, "Renew all SSH key pairs of all nodes nodes."),
   ]
 
index 3044a59..a0d8cac 100644 (file)
@@ -946,10 +946,12 @@ class NodeRequestHandler(http.server.HttpServerHandler):
     """
     (node_uuids, node_names, master_candidate_uuids,
      potential_master_candidates, old_key_type, new_key_type,
-     new_key_bits) = params
+     new_key_bits, debug, verbose) = params
     return backend.RenewSshKeys(node_uuids, node_names, master_candidate_uuids,
                                 potential_master_candidates, old_key_type,
-                                new_key_type, new_key_bits)
+                                new_key_type, new_key_bits,
+                                ssh_update_debug=debug,
+                                ssh_update_verbose=verbose)
 
   @staticmethod
   def perspective_node_ssh_key_remove(params):