]> git.decadent.org.uk Git - dak.git/commitdiff
init_db.py: `Cnf.get' fix for `do_priority'
authorMario Domenech Goulart <mario@ossystems.com.br>
Mon, 8 Feb 2010 18:45:35 +0000 (16:45 -0200)
committerMario Domenech Goulart <mario@ossystems.com.br>
Mon, 8 Feb 2010 18:45:35 +0000 (16:45 -0200)
Apparently, the `get' method expects its secong argument to be an
string, not a number.  Without this fix I get

      p.level    = self.Cnf.get("Priority::%s", 0)
  TypeError: argument 2 must be string, not int

Setting the second arg as "0" makes the error disappear.

Signed-off-by: Mario Domenech Goulart <mario@ossystems.com.br>
dak/init_db.py

index a34ec4cfac2114f5e34123bc47040a2ccab19e64..daccddefda76f353818118d599b38cfad3dab21f 100755 (executable)
@@ -174,7 +174,7 @@ class InitDB(object):
         for priority in self.Cnf.SubTree("Priority").List():
             p = Priority()
             p.priority = priority
-            p.level    = self.Cnf.get("Priority::%s", 0)
+            p.level    = self.Cnf.get("Priority::%s", "0")
             s.add(p)
 
         s.commit()