glennake / DirectFire_Converter

DirectFire Firewall Converter - Network Security, Next-Generation Firewall Configuration Conversion, Firewall Syntax Translation and Firewall Migration Tool - supports Cisco ASA, Fortinet FortiGate (FortiOS), Juniper SRX (JunOS), SSG / Netscreen (ScreenOS) and WatchGuard (support for further devices in development). Similar to FortiConverter, SmartMove, Expedition etc.
GNU General Public License v3.0
50 stars 17 forks source link

AttributeError: 'NoneType' object has no attribute 'group' #7

Closed Abdelmouhssine closed 3 years ago

Abdelmouhssine commented 3 years ago

Hello , i'm trying to execute the script via the command : python3.6 converter.py -s fortigate -d ciscoasa -c addresses-out.csv and i'm getting this errors:

builtins.AttributeError: 'NoneType' object has no attribute 'group'

Traceback (most recent call last): File "converter.py", line 254, in main(src_format=args.source, dst_format=args.destination, routing_info=args.routing) File "/usr/local/lib/python3.6/site-packages/traceback_with_variables/print.py", line 98, in wrapper return func(*args, **kwargs) File "converter.py", line 231, in main src_format=src_format, src_config=src_config, routing_info=routing_info File "converter.py", line 127, in parse parsed_data = parse(src_config, routing_info) File "/root/DirectFire_Converter/DirectFire/Converter/parsers/fortigate.py", line 71, in parse data["system"]["hostname"] = re_match.group(1) AttributeError: 'NoneType' object has no attribute 'group'

What to do . ??

glennake commented 3 years ago

Hi @Abdelmouhssine,

The tools expects a full configuration file input, but it appears you are providing a file called "addresses-out.csv". With the source format you have selected (FortiGate), the configuration is normally in a text based format with a ".conf" file extension.

Can you provide examples of what you are trying to convert?

Thanks