CiscoTestAutomation / pyats

Cisco DevNet pyATS Test Framework Bug Tracker
Apache License 2.0
152 stars 32 forks source link

class: yang.connector.Netconf does not work with alias #253

Open euserb opened 6 days ago

euserb commented 6 days ago
devices:
  pe1:
    alias: pe1
    type: router
    os: iosxr
    tacacs:
      username: admin
    passwords:
      tacacs: admin
    connections:
      defaults:
        via: netconf
      netconf:
        class: yang.connector.Netconf
        ip: 172.20.20.15
        port: 830
        username: clab
        password: clab@123
        credentials:
          netconf:
            username: clab
            password: clab@123
from pyats.topology.loader import load
testbed = load(<path-to-testbed>)
device1 = testbed.devices['pe1']

device1.connect(via='netconf')
2024-11-20T16:07:33: %NETCONF-INFO: NETCONF CONNECTED

device1.connect(alias='get', via='netconf')
{
    "name": "TypeError",
    "message": "'Netconf' object is not callable",
    "stack": "---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[13], line 1
----> 1 device1.connect(alias='get', via='netconf')
      2 # device1.connect(via='netconf')

File src/pyats/connections/manager.py:500, in pyats.connections.manager.ConnectionManager.connect()

File src/pyats/connections/manager.py:465, in pyats.connections.manager.ConnectionManager.instantiate()

File src/pyats/connections/manager.py:97, in pyats.connections.manager.Connections.__getitem__()

TypeError: 'Netconf' object is not callable"
}

It seems that the alias doesn't work...

euserb commented 6 days ago

it seems that if I use any other alias it works... I'll change my code...