Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Commit

Permalink
Merge 84cbff4 into 30fc616
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai Hoang Dang committed Jul 9, 2018
2 parents 30fc616 + 84cbff4 commit 0b1e652
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions sktm/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ def __del__(self):
self.conn.close()

def createdb(self, db):
tc = sqlite3.connect(db)
c = tc.cursor()
conn = sqlite3.connect(db)
cur = conn.cursor()

# FIXME The "patchsource_id" field should be a part of the primary key
# for "patch" table.
c.executescript("""
cur.executescript("""
PRAGMA foreign_keys = on;
CREATE TABLE baserepo(
Expand Down Expand Up @@ -85,9 +85,9 @@ def createdb(self, db):
FOREIGN KEY(testrun_id) REFERENCES testrun(id)
);""")

tc.commit()
c.close()
tc.close()
conn.commit()
cur.close()
conn.close()

def create_repoid(self, baserepo):
"""Create a repoid for a git repo URL.
Expand Down Expand Up @@ -598,7 +598,7 @@ def dump_baserepo_info(self): # pragma: no cover
stable = self.get_stable(burl)
latest = self.get_latest(burl)
print("most recent stable commit: {} ({})".format(
stable, self.get_commitdate(burl, stable)))
stable, self.get_commitdate(burl, stable)))
print("most recent stable commit: {} ({})".format(
latest, self.get_commitdate(burl, latest)))
latest, self.get_commitdate(burl, latest)))
print("---")
12 changes: 6 additions & 6 deletions sktm/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def __get_data_list(self, jobname, buildid, stepname, key):
raise Exception("No results for build %d (%s)" %
(buildid, build.get_status()))

for (k, v) in build.get_resultset().iteritems():
if k == stepname:
value_list.append(v.__dict__[key])
for (key, value) in build.get_resultset().iteritems():
if key == stepname:
value_list.append(value.__dict__[key])

return value_list

Expand Down Expand Up @@ -256,9 +256,9 @@ def get_result(self, jobname, buildid):

# Find earliest (worst) step failure
step_failure_result_list = [
("skt.cmd_merge", sktm.tresult.MERGE_FAILURE),
("skt.cmd_build", sktm.tresult.BUILD_FAILURE),
("skt.cmd_run", sktm.tresult.TEST_FAILURE),
("skt.cmd_merge", sktm.tresult.MERGE_FAILURE),
("skt.cmd_build", sktm.tresult.BUILD_FAILURE),
("skt.cmd_run", sktm.tresult.TEST_FAILURE),
]
for (step, failure_result) in step_failure_result_list:
if set(self.__get_data_list(jobname, buildid, step, "status")) & \
Expand Down
4 changes: 2 additions & 2 deletions sktm/patchwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,8 @@ def update_patch_name(self, patch):
"""
if 'root_comment' in patch:
# internal RH only: rewrite the original subject line
e = email.message_from_string(patch['root_comment']['headers'])
subject = e.get('Subject')
msg = email.message_from_string(patch['root_comment']['headers'])
subject = msg.get('Subject')
if subject is not None:
subject = subject.replace('\n\t', ' ').replace('\n', ' ')
# TODO What happens when subject is None?
Expand Down

0 comments on commit 0b1e652

Please sign in to comment.