diff -U3 -r bitten.orig/bitten/model.py bitten.patched/bitten/model.py
|
old
|
new
|
|
| 217 | 217 | handle_ta = False |
| 218 | 218 | |
| 219 | 219 | cursor = db.cursor() |
| 220 | | cursor.execute("DELETE FROM bitten_rule WHERE id=%s", (self.id,)) |
| | 220 | cursor.execute("DELETE FROM bitten_rule WHERE id=%s", (str(self.id),)) |
| 221 | 221 | cursor.execute("DELETE FROM bitten_platform WHERE id=%s", (self.id,)) |
| 222 | 222 | if handle_ta: |
| 223 | 223 | db.commit() |
| … |
… |
|
| 241 | 241 | self.id = db.get_last_id(cursor, 'bitten_platform') |
| 242 | 242 | if self.rules: |
| 243 | 243 | cursor.executemany("INSERT INTO bitten_rule VALUES (%s,%s,%s,%s)", |
| 244 | | [(self.id, propname, pattern, idx) |
| | 244 | [(str(self.id), propname, pattern, idx) |
| 245 | 245 | for idx, (propname, pattern) |
| 246 | 246 | in enumerate(self.rules)]) |
| 247 | 247 | |
| … |
… |
|
| 263 | 263 | cursor = db.cursor() |
| 264 | 264 | cursor.execute("UPDATE bitten_platform SET name=%s WHERE id=%s", |
| 265 | 265 | (self.name, self.id)) |
| 266 | | cursor.execute("DELETE FROM bitten_rule WHERE id=%s", (self.id,)) |
| | 266 | cursor.execute("DELETE FROM bitten_rule WHERE id=%s", (str(self.id),)) |
| 267 | 267 | if self.rules: |
| 268 | 268 | cursor.executemany("INSERT INTO bitten_rule VALUES (%s,%s,%s,%s)", |
| 269 | | [(self.id, propname, pattern, idx) |
| | 269 | [(str(self.id), propname, pattern, idx) |
| 270 | 270 | for idx, (propname, pattern) |
| 271 | 271 | in enumerate(self.rules)]) |
| 272 | 272 | |
| … |
… |
|
| 288 | 288 | platform = TargetPlatform(env, config=row[0], name=row[1]) |
| 289 | 289 | platform.id = id |
| 290 | 290 | cursor.execute("SELECT propname,pattern FROM bitten_rule " |
| 291 | | "WHERE id=%s ORDER BY orderno", (id,)) |
| | 291 | "WHERE id=%s ORDER BY orderno", (str(id),)) |
| 292 | 292 | for propname, pattern in cursor: |
| 293 | 293 | platform.rules.append((propname, pattern)) |
| 294 | 294 | return platform |
| … |
… |
|
| 417 | 417 | cursor.execute("INSERT INTO bitten_build (config,rev,rev_time,platform," |
| 418 | 418 | "slave,started,stopped,status) " |
| 419 | 419 | "VALUES (%s,%s,%s,%s,%s,%s,%s,%s)", |
| 420 | | (self.config, self.rev, int(self.rev_time), |
| | 420 | (self.config, str(self.rev), int(self.rev_time), |
| 421 | 421 | self.platform, self.slave or '', self.started or 0, |
| 422 | 422 | self.stopped or 0, self.status)) |
| 423 | 423 | self.id = db.get_last_id(cursor, 'bitten_build') |
| … |
… |
|
| 494 | 494 | if config is not None: |
| 495 | 495 | where_clauses.append(("config=%s", config)) |
| 496 | 496 | if rev is not None: |
| 497 | | where_clauses.append(("rev=%s", rev)) |
| | 497 | where_clauses.append(("rev=%s", str(rev))) |
| 498 | 498 | if platform is not None: |
| 499 | 499 | where_clauses.append(("platform=%s", platform)) |
| 500 | 500 | if slave is not None: |
diff -U3 -r bitten.orig/bitten/tests/model.py bitten.patched/bitten/tests/model.py
|
old
|
new
|
|
| 186 | 186 | self.assertEqual(('test', 'Windows XP'), cursor.fetchone()) |
| 187 | 187 | |
| 188 | 188 | cursor.execute("SELECT propname,pattern,orderno FROM bitten_rule " |
| 189 | | "WHERE id=%s", (platform.id,)) |
| | 189 | "WHERE id=%s", (str(platform.id),)) |
| 190 | 190 | self.assertEqual((Build.OS_NAME, 'Windows', 0), cursor.fetchone()) |
| 191 | 191 | self.assertEqual((Build.OS_VERSION, 'XP', 1), cursor.fetchone()) |
| 192 | 192 | |