Skip to content

Commit 578c2b7

Browse files
authored
fix service-tcp import error with delayed-sync-value (#108)
* support limit object * support limit object * export delayed-sync-value of service-tcp depending on field values
1 parent d5e8742 commit 578c2b7

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

exporting/export_objects.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,14 +489,15 @@ def clean_objects(data_dict):
489489
if api_type == 'simple-cluster' or api_type == 'simple-gateway' or 'service' in api_type:
490490
for dependent_field in fields_to_exclude_due_to_value_of_other_fields:
491491
if dependent_field in obj:
492-
# currently there's just 1 independent field; if there'll be more will need to add a 'break' if the
493-
# presence of any of the independent fields requires removal of the dependent field
492+
# for each dependant field, in the presence of any of it's independent fields in the object with
493+
# the same value as in the dict, the dependant field is removed
494494
for independent_field in fields_to_exclude_due_to_value_of_other_fields[dependent_field].keys():
495495
if independent_field in obj and obj[independent_field] == fields_to_exclude_due_to_value_of_other_fields[dependent_field][independent_field]:
496496
obj.pop(dependent_field, None)
497497
debug_log("The field " + dependent_field + " was removed from object of type " +
498498
api_type + " named " + obj["name"] + " since it cannot be present when the "
499499
"value of " + independent_field + " is " + str(obj[independent_field]))
500+
break
500501

501502
# converted_fields_to_add = {}
502503
for field in list(obj):

import_export_package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_version(client):
2626
if sys.version_info < (3, 7):
2727
raise Exception("Min Python version required is 3.7")
2828

29-
arg_parser = argparse.ArgumentParser(description="R80.X Policy Package Export/Import Tool, V6.2.1")
29+
arg_parser = argparse.ArgumentParser(description="R80.X Policy Package Export/Import Tool, V6.2.2")
3030
args = process_arguments(arg_parser)
3131
if args.force:
3232
args.unsafe_auto_accept = True

lists_and_dictionaries.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,8 @@
984984
"firewall-settings.memory-pool-size": {
985985
"firewall-settings.auto-calculate-connections-hash-table-size-and-memory-pool": True},
986986
"firewall-settings.maximum-memory-pool-size": {
987-
"firewall-settings.auto-calculate-connections-hash-table-size-and-memory-pool": True}
987+
"firewall-settings.auto-calculate-connections-hash-table-size-and-memory-pool": True},
988+
"delayed-sync-value": {"use-delayed-sync": False, "sync-connections-on-cluster": False}
988989
}
989990

990991
# in cases where the request is a single value (e.g name) and the reply is the corresponding object, we wish to create

0 commit comments

Comments
 (0)