From 8e30fbde7661acfc54c7efb7a60807e58f4bc8cc Mon Sep 17 00:00:00 2001 From: mao xiaojuan Date: Tue, 10 Jul 2018 13:54:42 +0800 Subject: [PATCH] Add the public jira info. Change-Id: I3ced34a78f29cc5b3c1d4f6399db103c63cdd1fa --- pmb/job_tool_jira_receiver.py | 9 ++++----- pmb/job_tool_sender.py | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) mode change 100755 => 100644 pmb/job_tool_sender.py diff --git a/pmb/job_tool_jira_receiver.py b/pmb/job_tool_jira_receiver.py index b60c14f..dac5692 100644 --- a/pmb/job_tool_jira_receiver.py +++ b/pmb/job_tool_jira_receiver.py @@ -65,8 +65,8 @@ class TOOLS_DB(BuildMonitorExtention): if jira_key_id > 0: #update - query = "UPDATE %s SET status = \"%s\" WHERE jira_key = " % (table, item['status']) + "%s" - query_data = (item['status'],) + query = "UPDATE %s SET status = \"%s\" WHERE jira_key = " % (table, item['status']) + "%s" + query_data = (item['jira_key'],) do_query(query, query_data) @@ -108,8 +108,8 @@ class TOOLS_DB(BuildMonitorExtention): print "commit_id : ", commit_id if commit_id > 0: #update - query = "UPDATE %s SET test_status = \"%s\" WHERE commit_id = " % (table, item['commit_id']) + "%s" - query_data = (item['test_status'],) + query = "UPDATE %s SET test_status = \"%s\" WHERE commit_id = " % (table, item['test_status']) + "%s" + query_data = (item['commit_id'],) do_query(query, query_data) @@ -133,7 +133,6 @@ if __name__ == "__main__": f = open( 'file0', 'r') str1 = subprocess.check_output('pwd') - print str1 RAW = unicode_to_str(json.loads(f.read())) f.close() print "RAW = %s" % RAW diff --git a/pmb/job_tool_sender.py b/pmb/job_tool_sender.py old mode 100755 new mode 100644 index 149fba8..f2cb461 --- a/pmb/job_tool_sender.py +++ b/pmb/job_tool_sender.py @@ -22,7 +22,7 @@ class SendData(object): JENKINS_SESSION = requests.Session() JENKINS_SESSION.trust_env = False JENKINS['item'] = [] - url = os.getenv(type + '_URL') + url = os.getenv(type + '_URL') print '[INFO] JENKINS url : ', url, '\n' headers = { 'content-type' : 'application/json', 'Accept-Charset' : 'UTF-8' } data_url = url + '/job/' + job_name + '/' + build_number + '/api/json?pretty=true' @@ -238,12 +238,12 @@ if __name__ == "__main__": JIRA = {} JIRA['item'] = [] SEND = {} - + # get data in spin jira sender.get_jira_data(JIRA, SEND, 'SPIN_JIRA', os.getenv("SPIN_JIRA_USER"), os.getenv("SPIN_JIRA_PW")) - # get data in spin jira - #sender.get_jira_data(JIRA, SEND, 'PUBLIC_JIRA', os.getenv("PUBLIC_JIRA_USER"), os.getenv("PUBLIC_JIRA_PW")) + # get data in dev jira + sender.get_jira_data(JIRA, SEND, 'PUBLIC_JIRA', os.getenv("PUBLIC_JIRA_USER"), os.getenv("PUBLIC_JIRA_PW")) sender.send_data(CONFIG, SEND) -- 2.7.4