X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/9fa2e1501e5726da7f794ef31d5b910848525349..6b0391b3e3c9b086213ec88bc8c28c85f199ae6b:/lib/jqueue.py diff --git a/lib/jqueue.py b/lib/jqueue.py index f989ef8..1b10b71 100644 --- a/lib/jqueue.py +++ b/lib/jqueue.py @@ -882,7 +882,7 @@ class JobQueue(object): @return: the path to the job file """ - return os.path.join(constants.QUEUE_DIR, "job-%s" % job_id) + return utils.PathJoin(constants.QUEUE_DIR, "job-%s" % job_id) @classmethod def _GetArchivedJobPath(cls, job_id): @@ -895,7 +895,7 @@ class JobQueue(object): """ path = "%s/job-%s" % (cls._GetArchiveDirectory(job_id), job_id) - return os.path.join(constants.JOB_QUEUE_ARCHIVE_DIR, path) + return utils.PathJoin(constants.JOB_QUEUE_ARCHIVE_DIR, path) @classmethod def _ExtractJobID(cls, name): @@ -1321,7 +1321,7 @@ class JobQueue(object): all_job_ids = self._GetJobIDsUnlocked(archived=False) pending = [] for idx, job_id in enumerate(all_job_ids): - last_touched = idx + last_touched = idx + 1 # Not optimal because jobs could be pending # TODO: Measure average duration for job archival and take number of @@ -1351,7 +1351,7 @@ class JobQueue(object): if pending: archived_count += self._ArchiveJobsUnlocked(pending) - return (archived_count, len(all_job_ids) - last_touched - 1) + return (archived_count, len(all_job_ids) - last_touched) @staticmethod def _GetJobInfoUnlocked(job, fields):