Revision 4fdedd09 lib/jstore.py

b/lib/jstore.py
42 42

  
43 43
  """
44 44
  try:
45
    return int(utils.ReadFile(file_name))
45
    contents = utils.ReadFile(file_name)
46 46
  except EnvironmentError, err:
47 47
    if err.errno in (errno.ENOENT, ):
48 48
      return None
49 49
    raise
50 50

  
51
  try:
52
    return int(contents)
53
  except (ValueError, TypeError), err:
54
    # Couldn't convert to int
55
    raise errors.JobQueueError("Content of file '%s' is not numeric: %s" %
56
                               (file_name, err))
57

  
51 58

  
52 59
def ReadSerial():
53 60
  """Read the serial file.

Also available in: Unified diff