File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ # coding=utf-8
2+ from atlassian import Jira
3+
4+ jira = Jira (url = "https://jira.example.com" , username = "mskymoore" , password = "admin" )
5+
6+ alive_node_ids = [_ ["nodeId" ] for _ in jira .get_cluster_alive_nodes ()]
7+
8+ zips_creation_task_id = jira .generate_support_zip_on_nodes (alive_node_ids )["clusterTaskId" ]
9+
10+ in_progress_zips = list ()
11+
12+ while True :
13+
14+ for task in jira .check_support_zip_status (zips_creation_task_id )["tasks" ]:
15+
16+ if task ["status" ] == "IN_PROGRESS" :
17+ print (f"file { task ['fileName' ]} { task ['progressMessage' ]} " )
18+
19+ if task ["fileName" ] not in in_progress_zips :
20+ in_progress_zips .append (task ["fileName" ])
21+
22+ else :
23+ support_zip = jira .download_support_zip (task ["fileName" ])
24+
25+ with open (task ["fileName" ], "wb" ) as fp :
26+ fp .write (support_zip )
27+
28+ print (f"{ task ['fileName' ]} written." )
29+
30+ if task ["fileName" ] in in_progress_zips :
31+ in_progress_zips .remove (task ["fileName" ])
32+
33+ if len (in_progress_zips ) == 0 :
34+ break
You can’t perform that action at this time.
0 commit comments