ia64/xen-unstable

changeset 13038:d0f682ada0b2

Add some exception logging.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Thu Dec 14 15:10:47 2006 +0000 (2006-12-14)
parents c91f6506b270
children 85c1e2383e98
files tools/python/xen/xend/XendStorageRepository.py
line diff
     1.1 --- a/tools/python/xen/xend/XendStorageRepository.py	Thu Dec 14 14:54:24 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendStorageRepository.py	Thu Dec 14 15:10:47 2006 +0000
     1.3 @@ -20,6 +20,7 @@
     1.4  #
     1.5  
     1.6  import commands
     1.7 +import logging
     1.8  import os
     1.9  import stat
    1.10  import threading
    1.11 @@ -35,7 +36,10 @@ XEND_STORAGE_QCOW_FILENAME = "%s.qcow"
    1.12  XEND_STORAGE_VDICFG_FILENAME = "%s.vdi.xml"
    1.13  QCOW_CREATE_COMMAND = "/usr/sbin/qcow-create %d %s"
    1.14  
    1.15 -MB = 1024 *1024
    1.16 +MB = 1024 * 1024
    1.17 +
    1.18 +log = logging.getLogger("xend.XendStorageRepository")
    1.19 +
    1.20  
    1.21  class DeviceInvalidError(Exception):
    1.22      pass
    1.23 @@ -89,8 +93,7 @@ class XendStorageRepository:
    1.24                  open(uuid_file, 'w').write(new_uuid + '\n')
    1.25                  return new_uuid
    1.26          except IOError:
    1.27 -            # TODO: log warning
    1.28 -            pass
    1.29 +            log.exception()
    1.30  
    1.31          return uuid.createString()
    1.32  
    1.33 @@ -229,8 +232,7 @@ class XendStorageRepository:
    1.34                      if cfg_path and os.path.exists(cfg_path):
    1.35                          os.unlink(cfg_path)
    1.36                  except OSError:
    1.37 -                    # TODO: log warning
    1.38 -                    pass
    1.39 +                    log.exception()
    1.40                  del self.images[image_uuid]
    1.41                  return True
    1.42          finally: