napalm-automation-community / napalm-asa

napalm-asa
Apache License 2.0
17 stars 13 forks source link

Python 3 Support #7

Closed DiogoAndre closed 6 years ago

DiogoAndre commented 6 years ago

Compatibility with Python 3 is needed. We can use napalm-automation/napalm#199 as a reference.

wvandeun commented 6 years ago

I think you can close this issue. The recent changes that have been made, had the pleasant side effect of providing support for Python3.

(napalm-asa-r220919q) napalm-asa $ python --version
Python 3.6.5
(napalm-asa-r220919q) napalm-asa $ napalm --user cisco --password cisco --optional_args "port=8443" --vendor asa 192.168.2.10 call get_facts
{
    "uptime": 20,
    "vendor": "Cisco Systems",
    "os_version": "9.7(1)24",
    "serial_number": "zip",
    "model": "ASAv",
    "hostname": "asav",
    "fqdn": "asav.lab.local",
    "interface_list": [
        "GigabitEthernet0/1",
        "GigabitEthernet0/0",
        "Management0/0",
        "GigabitEthernet0/2",
        "GigabitEthernet0/3",
        "GigabitEthernet0/4",
        "GigabitEthernet0/5",
        "GigabitEthernet0/6",
        "GigabitEthernet0/7",
        "GigabitEthernet0/8"
    ]
}
DiogoAndre commented 6 years ago

Yes, I noticed it works too, but there is something going on with the tests though. Still checking.

wvandeun commented 6 years ago

Do you mean the test test_get_interfaces (and therefor also test_get_facts) that is failing? I think you'll have to reorder the interfaces in _interfaces_physical.json to match with the order of the interfaces in this filename _cli_show_interface_GigabitEthernet0_1_show_interface_GigabitEthernet0_0_show_interface_Management0_0.json. Then the tests should succeed.