Merge branch 'stable-2.16' into stable-2.17
[ganeti-github.git] / lib / cmdlib / cluster / __init__.py
index 98e46dd..21200f3 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
@@ -1479,6 +1481,20 @@ class LUClusterSetParams(LogicalUnit):
         feedback_fn("Cluster LVM configuration already in desired"
                     " state, not changing")
 
+  def _SetDiagnoseDataCollectorFilename(self, feedback_fn):
+    """Determines and sets the filename of the script
+    diagnose data collector should run.
+
+    """
+    if self.op.diagnose_data_collector_filename is not None:
+      fn = self.op.diagnose_data_collector_filename
+      if fn != self.cfg.GetDiagnoseDataCollectorFilename():
+        self.cfg.SetDiagnoseDataCollectorFilename(fn)
+      else:
+        feedback_fn("Diagnose data collector filename"
+                    " configuration already in desired"
+                    " state, not changing")
+
   def _SetFileStorageDir(self, feedback_fn):
     """Set the file storage directory.
 
@@ -1646,6 +1662,7 @@ class LUClusterSetParams(LogicalUnit):
     self._SetSharedFileStorageDir(feedback_fn)
     self.cfg.Update(self.cluster, feedback_fn)
     self._SetDrbdHelper(feedback_fn)
+    self._SetDiagnoseDataCollectorFilename(feedback_fn)
 
     # re-read the fresh configuration again
     self.cluster = self.cfg.GetClusterInfo()
@@ -1711,6 +1728,15 @@ class LUClusterSetParams(LogicalUnit):
     if self.op.modify_etc_hosts is not None:
       self.cluster.modify_etc_hosts = self.op.modify_etc_hosts
 
+    if self.op.modify_ssh_setup is not None:
+      if (self.op.modify_ssh_setup and
+          not self.cfg.GetClusterInfo().modify_ssh_setup):
+        feedback_fn(
+          "Enabling modify_ssh_setup for cluster. You may need to run"
+          " 'gnt-cluster renew-crypto --new-ssh-keys --no-ssh-key-check'"
+          " to redistribute the ssh public key settings for each node.")
+      self.cluster.modify_ssh_setup = self.op.modify_ssh_setup
+
     if self.op.prealloc_wipe_disks is not None:
       self.cluster.prealloc_wipe_disks = self.op.prealloc_wipe_disks
 
@@ -1824,6 +1850,15 @@ class LUClusterSetParams(LogicalUnit):
     if self.op.compression_tools is not None:
       self.cfg.SetCompressionTools(self.op.compression_tools)
 
+    if self.op.maint_round_delay is not None:
+      self.cfg.SetMaintdRoundDelay(self.op.maint_round_delay)
+
+    if self.op.maint_balance is not None:
+      self.cfg.SetMaintdBalance(self.op.maint_balance)
+
+    if self.op.maint_balance_threshold is not None:
+      self.cfg.SetMaintdBalanceThreshold(self.op.maint_balance_threshold)
+
     network_name = self.op.instance_communication_network
     if network_name is not None:
       return self._ModifyInstanceCommunicationNetwork(self.cfg,