Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash for exporting inline rules when slash , perhaps also other special characters #91

Open
pepjm opened this issue Feb 13, 2024 · 0 comments

Comments

@pepjm
Copy link

pepjm commented Feb 13, 2024

Hi

crash for exporting inline rules when slash in the name of the inline rule
( perhaps also other special characters )

Thank you for correction
Jean-michel

here example: inline rule "devpacc0018-bs/axi"
here some inputs

Python .\ExportImportPolicyPackage-master\import_export_package.py -op export -n firewall00_policy -m xxx.yyy.zzz.2 -u userX -p mypassword
-o firewall00_policy -ac true -tp true --nat true --https false

Exporting Access Layer [devpacc0018-axi]

Retrieved 3 out of 3 rules (100%)

Processing rules and sections
Exporting applications-sites from layer [devpacc0018-axi]
Exporting groups from layer [devpacc0018-axi]
Exporting networks from group [WP_Public_Net]
Exporting hosts from layer [devpacc0018-axi]
Exporting access rules from layer [devpacc0018-axi]
Exporting access sections from layer [devpacc0018-axi]
Exporting placeholders for unexportable objects from layer [devpacc0018-axi]
Exporting layer settings of layer [devpacc0018-axi]
Done exporting layer 'devpacc0018-axi'.

Exporting Inline-Layer [devpacc0018-bs/axi]
Exporting Access Layer [devpacc0018-bs/axi]

Retrieved 5 out of 5 rules (100%)

Processing rules and sections
Exporting applications-sites from layer [devpacc0018-bs/axi]
Exporting networks from layer [devpacc0018-bs/axi]
Exporting groups from layer [devpacc0018-bs/axi]
Exporting networks from group [WP_Public_Net]
Exporting hosts from layer [devpacc0018-bs/axi]
Exporting access rules from layer [devpacc0018-bs/axi]
Exporting access sections from layer [devpacc0018-bc/axi]
Exporting placeholders for unexportable objects from layer [devpacc0018-bs/axi]
Exporting layer settings of layer [devpacc0018-bs/axi]
Done exporting layer 'devpacc0018-bs/axi'.

Traceback (most recent call last):
File "D:\Automation\checkpointPoliciesDownload\ExportImportPolicyPackage-master\import_export_package.py", line 73, in
export_package(client, args)
File "D:\Automation\checkpointPoliciesDownload\ExportImportPolicyPackage-master\exporting\export_package.py", line 44, in export_package
= export_access_rulebase(show_package.data["name"], access_layer["name"], access_layer["uid"], client, timestamp, tar_file)
File "D:\Automation\checkpointPoliciesDownload\ExportImportPolicyPackage-master\exporting\export_access_rulebase.py", line 46,

in export_access_rulebase
create_tar_file(access_layer, inner_data_dict,
File "D:\Automation\checkpointPoliciesDownload\ExportImportPolicyPackage-master\utils.py", line 244, in create_tar_file
with tarfile.open(layer_tar_name, "w:gz") as tar:
File "C:\Program Files\Python39\lib\tarfile.py", line 1638, in open
return func(name, filemode, fileobj, **kwargs)
File "C:\Program Files\Python39\lib\tarfile.py", line 1684, in gzopen
fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
File "C:\Program Files\Python39\lib\gzip.py", line 173, in init
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'exported__access_layer__devpacc0018-bs/axi__2024_02_12_20_34.tar.gz'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant