10 with open(
'cookiefile.txt',
'r')
as f:
12 line = line.rstrip(
'\n')
13 if line.find(
'JSESSIONID') > - 1:
14 sessionid = line.split()[-1]
19 headers={
'cookie':
'JSESSIONID=%s' % (sessionid),
'Content-Type':
'application/json'}
24 for i
in xrange(1,len(sys.argv)):
25 if sys.argv[i] ==
"-f" :
26 with open (sys.argv[i+1],
"r")
as myfile:
27 myrequest = myfile.read()
30 myrequest += sys.argv[i]
39 print "no message to post"
46 result = requests.post(
'https://its.cern.ch/jira/rest/api/2/issue/ATLINFR-2021/comment', headers=headers, data=json.dumps(data))
48 print json.dumps(result.json(), indent=4)