From: Guido Trotter Date: Wed, 5 May 2010 14:36:25 +0000 (+0200) Subject: backend: remove a couple of useless mkdir calls X-Git-Tag: v2.1.3~125 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/0a865080e621bb0fa228fc6c68b180bf712dd85e?ds=sidebyside backend: remove a couple of useless mkdir calls Those directories must exist for the node daemon to run (it's in the node daemon's list of ensured directories) and those functions are only called by the node daemon, so there's no point in those checks+mkdir calls. Signed-off-by: Guido Trotter Reviewed-by: Balazs Lecz --- diff --git a/lib/backend.py b/lib/backend.py index 761628c..81f82bc 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -2030,8 +2030,6 @@ def ExportSnapshot(disk, dest_node, instance, cluster_name, idx, debug): export_script = inst_os.export_script logfile = _InstanceLogName("export", inst_os.name, instance.name) - if not os.path.exists(constants.LOG_OS_DIR): - os.mkdir(constants.LOG_OS_DIR, 0750) real_disk = _OpenRealBD(disk) @@ -2184,8 +2182,6 @@ def ImportOSIntoInstance(instance, src_node, src_images, cluster_name, debug): import_script = inst_os.import_script logfile = _InstanceLogName("import", instance.os, instance.name) - if not os.path.exists(constants.LOG_OS_DIR): - os.mkdir(constants.LOG_OS_DIR, 0750) comprcmd = "gunzip" impcmd = utils.BuildShellCmd("(cd %s; %s >%s 2>&1)", inst_os.path,