Commit 0411c011 authored by Iustin Pop's avatar Iustin Pop
Browse files

Switch more code to PathJoin



This should remove most of the remaining constructs which can be
replaced by PathJoin.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent e51db2a6
......@@ -2023,8 +2023,8 @@ def ExportSnapshot(disk, dest_node, instance, cluster_name, idx, debug):
comprcmd = "gzip"
destcmd = utils.BuildShellCmd("mkdir -p %s && cat > %s/%s",
destdir, destdir, destfile)
destcmd = utils.BuildShellCmd("mkdir -p %s && cat > %s",
destdir, utils.PathJoin(destdir, destfile))
remotecmd = _GetSshRunner(cluster_name).BuildCmd(dest_node,
constants.GANETI_RUNAS,
destcmd)
......@@ -2696,7 +2696,7 @@ class HooksRunner(object):
subdir = "%s-%s.d" % (hpath, suffix)
dir_name = "%s/%s" % (self._BASE_DIR, subdir)
dir_name = utils.PathJoin(self._BASE_DIR, subdir)
results = []
......@@ -2789,7 +2789,7 @@ class DevCacheManager(object):
if dev_path.startswith(cls._DEV_PREFIX):
dev_path = dev_path[len(cls._DEV_PREFIX):]
dev_path = dev_path.replace("/", "_")
fpath = "%s/bdev_%s" % (cls._ROOT_DIR, dev_path)
fpath = utils.PathJoin(cls._ROOT_DIR, "bdev_%s" % dev_path)
return fpath
@classmethod
......
......@@ -894,8 +894,8 @@ class JobQueue(object):
@return: the path to the archived job file
"""
path = "%s/job-%s" % (cls._GetArchiveDirectory(job_id), job_id)
return utils.PathJoin(constants.JOB_QUEUE_ARCHIVE_DIR, path)
return utils.PathJoin(constants.JOB_QUEUE_ARCHIVE_DIR,
cls._GetArchiveDirectory(job_id), "job-%s" % job_id)
@classmethod
def _ExtractJobID(cls, name):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment