Revision 526f866b lib/jstore.py

b/lib/jstore.py
203 203
  @return: Directory name
204 204

  
205 205
  """
206
  return str(int(job_id) / JOBS_PER_ARCHIVE_DIRECTORY)
206
  return str(ParseJobId(job_id) / JOBS_PER_ARCHIVE_DIRECTORY)
207

  
208

  
209
def ParseJobId(job_id):
210
  """Parses a job ID and converts it to integer.
211

  
212
  """
213
  try:
214
    return int(job_id)
215
  except (ValueError, TypeError):
216
    raise errors.ParameterError("Invalid job ID '%s'" % job_id)

Also available in: Unified diff