bootstrap: Set master node's {c,m}time on cluster init
[ganeti-local] / lib / bootstrap.py
index 961cc96..ea2a829 100644 (file)
@@ -402,6 +402,7 @@ def InitCluster(cluster_name, mac_prefix,
                                     serial_no=1,
                                     master_candidate=True,
                                     offline=False, drained=False,
+                                    ctime=now, mtime=now,
                                     )
   InitConfig(constants.CONFIG_VERSION, cluster_config, master_node_config)
   cfg = config.ConfigWriter(offline=True)
@@ -605,7 +606,7 @@ def MasterFailover(no_voting=False):
   try:
     # instantiate a real config writer, as we now know we have the
     # configuration data
-    cfg = config.ConfigWriter()
+    cfg = config.ConfigWriter(accept_foreign=True)
 
     cluster_info = cfg.GetClusterInfo()
     cluster_info.master_node = new_master