cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pdion...@apache.org
Subject [1/5] git commit: jira.py: add authentication now required by https://issues.apache.org/jira
Date Sun, 21 Sep 2014 14:29:20 GMT
Repository: cloudstack-docs-rn
Updated Branches:
  refs/heads/4.3 6a8eaa99f -> 2ffd4b24e


jira.py: add authentication now required by https://issues.apache.org/jira


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-rn/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-rn/commit/f1a4afd3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-rn/tree/f1a4afd3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-rn/diff/f1a4afd3

Branch: refs/heads/4.3
Commit: f1a4afd314e0e3f9a2a852071e742d3dd9b7ac43
Parents: 6a8eaa9
Author: Pierre-Luc Dion <pdion891@apache.org>
Authored: Sat Sep 20 11:02:54 2014 -0400
Committer: Pierre-Luc Dion <pdion891@apache.org>
Committed: Sun Sep 21 10:01:53 2014 -0400

----------------------------------------------------------------------
 utils/jira.py | 39 +++++++++++++++++++++++++++++++--------
 1 file changed, 31 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-docs-rn/blob/f1a4afd3/utils/jira.py
----------------------------------------------------------------------
diff --git a/utils/jira.py b/utils/jira.py
index c4b931d..e843cba 100755
--- a/utils/jira.py
+++ b/utils/jira.py
@@ -14,25 +14,48 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
- 
+"""jira.py: Output jira issues from https://issues.apache.org/jira into RST format for Apche
CloudStack Release-Notes.
+
+Usage:
+  jira.py FILTERID -p USERNAME -u PASSWORD
+  jira.py (-h | --help)
+  jira.py --version
+
+Options:
+  -h --help     Show this screen.
+  --version     Show version.
+
+"""
+from docopt import docopt
 import requests
 import json
 import sys
 import pprint
- 
-filterid=str(sys.argv[1])
-filterurl='https://issues.apache.org/jira/rest/api/2/filter/' + filterid
- 
-r=requests.get(filterurl)
+
+
+if __name__ == '__main__':
+    arguments = docopt(__doc__, version='jira.py 2.0')
+    #print(arguments)
+
+#print arguments['FILTERID']
+#print arguments['PASSWORD']
+#print arguments['USERNAME']
+
+filterurl='https://issues.apache.org/jira/rest/api/2/filter/' + arguments['FILTERID']
+
+
+r=requests.get(filterurl, auth=(arguments['USERNAME'],arguments['PASSWORD']))
 rlist=r.json()['searchUrl']
 
-count=requests.get(rlist).json()['total']
+get_all=requests.get(rlist, auth=(arguments['USERNAME'],arguments['PASSWORD'])).json()
+count=get_all['total']
 
+#print count
 n, m = divmod(count, 50)
 
 for i in range(n+1):
 
-    issueslist=requests.get(rlist+'&startAt='+str(i*50)).json()['issues']
+    issueslist=get_all['issues']
 
     for issue in issueslist:
         '''assignee=issue['fields']['assignee']['displayName']


Mime
View raw message