Developer

 View Only
last person joined: yesterday 

Expand all | Collapse all

Gettings started with NAPALM and PYAOSCX

This thread has been viewed 19 times
  • 1.  Gettings started with NAPALM and PYAOSCX

    Posted Dec 09, 2023 09:37 PM

    Hi there,

    I'm trying to get started with the automation tools at: https://developer.arubanetworks.com/aruba-aoscx/docs/using-the-aos-cx-napalm-drivers

    But I'm receiving an error with the PYAOSCX module when I attempt to issue the following command to NAPALM on the command-line on my automation server in my venv:

    python3 -c "from napalm_aoscx.aoscx import AOSCXDriver"

    (venv) [root@server netbox]# python3 -c "from napalm_aoscx.aoscx import AOSCXDriver"

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/opt/netbox-3.6.1/venv/lib/python3.10/site-packages/napalm_aoscx/__init__.py", line 16, in <module>

        from napalm_aoscx.aoscx import AOSCXDriver

      File "/opt/netbox-3.6.1/venv/lib/python3.10/site-packages/napalm_aoscx/aoscx.py", line 52, in <module>

        from pyaoscx import session, interface, system, common_ops, port, lldp, mac

    ImportError: cannot import name 'system' from 'pyaoscx' (/opt/netbox-3.6.1/venv/lib/python3.10/site-packages/pyaoscx/__init__.py)

    My virtual environment contains the necessary pre-requisite packages (output edited for brevity):

    (venv) [root@server netbox]# pip freeze

    napalm==4.1.0

    napalm-aruba-cx==0.1.4

    napalm-arubaos-switch==0.2.0

    pyaoscx==2.5.1

    requests==2.31.0

    urllib3==2.1.0

    I already tried reinstalling the packages by issuing:  pip3  install --upgrade --force napalm-aruba-cx napalm-arubaos-switch

    to no joy. Anyone have any ideas?



  • 2.  RE: Gettings started with NAPALM and PYAOSCX
    Best Answer

    MVP GURU
    Posted Dec 11, 2023 07:21 AM

    Hi,

    You need to use pyaoscx v1.0.0

    it is not yet(...) compatible with pysoascx 2.x

    https://github.com/napalm-automation-community/napalm-aruba-cx

    Note that the current version of this driver utilizes pyaoscx v1 only. Future versions of this driver will be compatible with pyaoscx v2



    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 3.  RE: Gettings started with NAPALM and PYAOSCX

    Posted Dec 11, 2023 07:42 AM

    Wow... Can't believe that I missed that.
    So, I issued the following command in my venv: pip3 install pyaoscx==1.0.0 --force-reinstall -v 
    After which, everything is fine. Thanks Alexis




  • 4.  RE: Gettings started with NAPALM and PYAOSCX

    MVP GURU
    Posted Dec 11, 2023 10:05 AM

    No problem :)

    (yes it is missing on developer aruba page.. or need to update napalm for support pyaoscx v2 also... 



    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------