瀏覽代碼

add method to get all the nodes from the old database

oz123 11 年之前
父節點
當前提交
16b832a509
共有 1 個文件被更改,包括 5 次插入7 次删除
  1. 5 7
      pwman/data/convertdb.py

+ 5 - 7
pwman/data/convertdb.py

@@ -59,13 +59,11 @@ class PwmanConvertDB(object):
     def read_old_db(self):
         "read the old db and get all nodes"
         self.db = pwman.data.factory.create(self.dbtype, self.dbver)
-
-    def run(self):
-        self.read_old_db()
-
         enc = CryptoEngine.get()
         enc.set_callback(CLICallback())
         self.db.open()
-        import ipdb; ipdb.set_trace()
-        self.db.getnodes([1])
-        pass
+        self.oldnodes = self.db.listnodes()
+        self.oldnodes = self.db.getnodes(self.oldnodes)
+
+    def run(self):
+        self.read_old_db()