mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
Add some exception logging.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
e5ec710fa4
commit
4a5cb14abe
1 file changed
+7
-5
@@ -20,6 +20,7 @@
|
||||
#
|
||||
|
||||
import commands
|
||||
import logging
|
||||
import os
|
||||
import stat
|
||||
import threading
|
||||
@@ -35,7 +36,10 @@ XEND_STORAGE_QCOW_FILENAME = "%s.qcow"
|
||||
XEND_STORAGE_VDICFG_FILENAME = "%s.vdi.xml"
|
||||
QCOW_CREATE_COMMAND = "/usr/sbin/qcow-create %d %s"
|
||||
|
||||
MB = 1024 *1024
|
||||
MB = 1024 * 1024
|
||||
|
||||
log = logging.getLogger("xend.XendStorageRepository")
|
||||
|
||||
|
||||
class DeviceInvalidError(Exception):
|
||||
pass
|
||||
@@ -89,8 +93,7 @@ class XendStorageRepository:
|
||||
open(uuid_file, 'w').write(new_uuid + '\n')
|
||||
return new_uuid
|
||||
except IOError:
|
||||
# TODO: log warning
|
||||
pass
|
||||
log.exception()
|
||||
|
||||
return uuid.createString()
|
||||
|
||||
@@ -229,8 +232,7 @@ class XendStorageRepository:
|
||||
if cfg_path and os.path.exists(cfg_path):
|
||||
os.unlink(cfg_path)
|
||||
except OSError:
|
||||
# TODO: log warning
|
||||
pass
|
||||
log.exception()
|
||||
del self.images[image_uuid]
|
||||
return True
|
||||
finally:
|
||||
|
||||