File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change
1
+ from utils import debug_log
2
+
3
+
1
4
def handle_fields (obj ):
2
5
if obj ["type" ] == "threat-profile" :
3
6
new_items = {}
@@ -11,7 +14,23 @@ def handle_fields(obj):
11
14
for index in range (len (obj [key ])):
12
15
for sub_index in range (len (obj [key ][index ]["values" ])):
13
16
new_items [new_key ].append ({"category" : obj [key ][index ]["name" ],
14
- "name" : obj [key ][index ]["values" ][sub_index ]["name" ]})
17
+ "name" : obj [key ][index ]["values" ][sub_index ]["name" ]})
18
+
19
+ if key == "overrides" :
20
+ new_overrides = []
21
+ for override in obj [key ]:
22
+ protection = override ["protection" ]
23
+ override_obj = override ["override" ]
24
+
25
+ new_override = {"protection" : protection }
26
+ for k , v in override_obj .items ():
27
+ new_override [k ] = v
28
+
29
+ new_overrides .append (new_override )
30
+
31
+ obj [key ] = new_overrides
32
+
33
+ debug_log (f"threat profile overrides: { obj [key ]} " )
15
34
for key in old_keys :
16
35
obj .pop (key )
17
36
for new_key , new_item in new_items .items ():
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def get_version(client):
26
26
if sys .version_info < (3 , 7 ):
27
27
raise Exception ("Min Python version required is 3.7" )
28
28
29
- arg_parser = argparse .ArgumentParser (description = "R80.X Policy Package Export/Import Tool, V6" )
29
+ arg_parser = argparse .ArgumentParser (description = "R80.X Policy Package Export/Import Tool, V6.1.0 " )
30
30
args = process_arguments (arg_parser )
31
31
if args .force :
32
32
args .unsafe_auto_accept = True
You can’t perform that action at this time.
0 commit comments