add source in backup/restore failure message
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 25 Jan 2010 19:36:04 +0100
changeset 4344 066e7884e57d
parent 4343 69bff38ebe91
child 4345 06a34ff6b49a
add source in backup/restore failure message
server/migractions.py
--- a/server/migractions.py	Mon Jan 25 19:28:09 2010 +0100
+++ b/server/migractions.py	Mon Jan 25 19:36:04 2010 +0100
@@ -148,7 +148,7 @@
                 try:
                     source.backup(osp.join(tmpdir, source.uri))
                 except Exception, exc:
-                    print '-> error trying to backup [%s]' % exc
+                    print '-> error trying to backup %s [%s]' % (source.uri, exc)
                     if not self.confirm('Continue anyway?', default='n'):
                         raise SystemExit(1)
                     else:
@@ -180,7 +180,7 @@
             bkup = tarfile.open(backupfile, 'r|gz')
         except tarfile.ReadError:
             # assume restoring old backup
-            shutil.copy(backupfile, osp.join(tmpdir, 'system'))  
+            shutil.copy(backupfile, osp.join(tmpdir, 'system'))
         else:
             for name in bkup.getnames():
                 if name[0] in '/.':
@@ -198,7 +198,7 @@
             try:
                 source.restore(osp.join(tmpdir, source.uri), self.confirm, drop)
             except Exception, exc:
-                print '-> error trying to restore [%s]' % exc
+                print '-> error trying to restore %s [%s]' % (source.uri, exc)
                 if not self.confirm('Continue anyway?', default='n'):
                     raise SystemExit(1)
         shutil.rmtree(tmpdir)