summaryrefslogtreecommitdiffstats
path: root/doc/gen_known_issues.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/gen_known_issues.py')
-rw-r--r--doc/gen_known_issues.py91
1 files changed, 91 insertions, 0 deletions
diff --git a/doc/gen_known_issues.py b/doc/gen_known_issues.py
new file mode 100644
index 0000000..a400577
--- /dev/null
+++ b/doc/gen_known_issues.py
@@ -0,0 +1,91 @@
1#!/usr/bin/python
2
3from subprocess import check_output
4import json, re, datetime
5import time
6
7jd = json.JSONDecoder()
8
9def jira_query(query):
10 jira_url = "http://eneaissues.enea.com"
11 fields = "key,summary"
12 query = query.replace(" ", "+")
13
14 cmd = ["curl",
15 "-s",
16 "-D-",
17 "-u", "rest_reader:jira123",
18 "-X", "GET",
19 "-H", "Content-Type: application/json",
20 jira_url + "/rest/api/2/search?jql=" + query + "&fields=" + fields
21 ]
22
23 tmp = check_output(cmd).splitlines()
24 tmp = jd.decode(tmp[-1])
25 return tmp["issues"]
26
27conditions = ("project=LXCR",
28 "issueType=bug",
29 "resolution=Unresolved",
30 'affectedversion="Enea Linux 6"'
31 )
32
33bugs = []
34
35time_str = time.strftime("%Y-%m-%d, %H:%M:%S (%Z)")
36
37for issue in jira_query(" and ".join(conditions)):
38 bugs.append((issue["key"], issue["fields"]["summary"]))
39
40print '<?xml version="1.0" encoding="ISO-8859-1"?>'
41print '<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"'
42print '"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">'
43print '<section id="relinfo-extracted-from-jira">'
44print ' <title>Extracted from Jira</title>'
45print
46print ' <para>'
47print ' This section lists open bugs in Jira. Extracted at %s.' % time_str
48print ' </para>'
49print
50print ' <remark>Jira query: (%s)</remark>' % "\n and ".join(conditions)
51print
52print ' <informaltable>'
53print ' <tgroup cols="2">'
54print ' <colspec colwidth="6*" colname="c1"/>'
55print
56print ' <colspec align="center" colwidth="1*" colname="c2"/>'
57print
58print ' <thead>'
59print ' <row>'
60print ' <entry align="center">Summary</entry>'
61print
62print ' <entry>Enea Ref</entry>'
63print ' </row>'
64print ' </thead>'
65print
66print ' <tbody>',
67
68if bugs:
69 for bug in sorted(bugs):
70 print
71 print ' <row>'
72 print ' <entry>%s</entry>' % bug[1]
73 print
74 print ' <entry>%s</entry>' % bug[0]
75 print ' </row>'
76
77else:
78 print ' <row>'
79 print ' <entry namest="c1" nameend="c2" align="center">'
80 print ' No issues found'
81 print ' </entry>'
82 print ' </row>'
83
84print ' </tbody>'
85print ' </tgroup>'
86print ' </informaltable>'
87
88if bugs:
89 print ' <para>Number of open bugs: %d</para>' % len(bugs)
90
91print '</section>'