Update NEWS file: issue 687 and configure fix
[ganeti-local] / tools / cfgupgrade12
index 5bf426d..dd76ce9 100755 (executable)
@@ -47,6 +47,7 @@ from ganeti import constants
 from ganeti import serializer
 from ganeti import utils
 from ganeti import cli
+from ganeti import pathutils
 
 
 options = None
@@ -195,7 +196,7 @@ def Cluster12To20(cluster):
 
   # file storage
   if "file_storage_dir" not in cluster:
-    cluster["file_storage_dir"] = constants.DEFAULT_FILE_STORAGE_DIR
+    cluster["file_storage_dir"] = pathutils.DEFAULT_FILE_STORAGE_DIR
 
   # candidate pool size
   if "candidate_pool_size" not in cluster:
@@ -262,7 +263,7 @@ def Disk12To20(drbd_minors, secrets, disk):
   """
   if "mode" not in disk:
     disk["mode"] = constants.DISK_RDWR
-  if disk["dev_type"] == constants.LD_DRBD8:
+  if disk["dev_type"] == constants.DT_DRBD8:
     old_lid = disk["logical_id"]
     for node in old_lid[:2]:
       if node not in drbd_minors:
@@ -296,8 +297,8 @@ def main():
   parser.add_option(cli.DEBUG_OPT)
   parser.add_option(cli.VERBOSE_OPT)
   parser.add_option("--path", help="Convert configuration in this"
-                    " directory instead of '%s'" % constants.DATA_DIR,
-                    default=constants.DATA_DIR, dest="data_dir")
+                    " directory instead of '%s'" % pathutils.DATA_DIR,
+                    default=pathutils.DATA_DIR, dest="data_dir")
   (options, args) = parser.parse_args()
 
   # We need to keep filenames locally because they might be renamed between