server/migractions.py
changeset 2867 e8581a4f1bae
parent 2835 04034421b072
parent 2861 9cb3027407aa
child 2968 0e3460341023
--- a/server/migractions.py	Fri Aug 14 15:53:12 2009 +0200
+++ b/server/migractions.py	Sun Aug 16 20:27:28 2009 +0200
@@ -169,16 +169,15 @@
         bkup = tarfile.open(backupfile, 'r|gz')
         tmpdir = tempfile.mkdtemp()
         bkup.extractall(path=tmpdir)
-        if systemonly:
-            repo.system_source.restore(osp.join(tmpdir,'system'), drop=drop)
-        else:
-            for source in repo.sources:
-                try:
-                    source.restore(osp.join(tmpdir, source.uri), drop=drop)
-                except Exception, exc:
-                    print '-> error trying to restore [%s]' % exc
-                    if not self.confirm('Continue anyway?', default='n'):
-                        raise SystemExit(1)
+        for source in repo.sources:
+            if systemonly and source.uri != 'system':
+                continue
+            try:
+                source.restore(osp.join(tmpdir, source.uri), drop=drop)
+            except Exception, exc:
+                print '-> error trying to restore [%s]' % exc
+                if not self.confirm('Continue anyway?', default='n'):
+                    raise SystemExit(1)
         bkup.close()
         shutil.rmtree(tmpdir)
         # call hooks