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

pyats testbed issue #133

Open
tzarski0 opened this issue Feb 19, 2025 · 2 comments
Open

pyats testbed issue #133

tzarski0 opened this issue Feb 19, 2025 · 2 comments

Comments

@tzarski0
Copy link

With pyats 25.1 installed, when running the run_command function, warnings are getting generated.
Example code:

from virl2_client import ClientLibrary
from virl2_client.models.cl_pyats import ClPyats

cml_ip = ...
cml_username = ...
cml_password = ...

node_label = "edge"

cml = ClientLibrary(cml_ip, cml_username, cml_password, ssl_verify=False)

lab = cml.find_labs_by_title("pyatstest")[0]
pylab = ClPyats(lab)
pylab.sync_testbed(cml_username, cml_password)
pylab._testbed.devices[node_label].credentials.default.username = "admin"
pylab._testbed.devices[node_label].credentials.default.password = "admin"

running_config = pylab.run_command(node_label, "show sdwan run")
print(running_config)

The following code generates warnings:

Could not find details in testbed for server terminal_server.
Could not find details in testbed for server terminal_server.
No details found in testbed for hostname terminal_server.
Could not find details in testbed for server terminal_server.
Could not find details in testbed for server terminal_server.
No details found in testbed for hostname terminal_server.

I assume there's something wrong with the testbed object that virl2_client generates. Ask is to fix it so no warnings are generated on run_command function.

@sgherdao
Copy link

sgherdao commented Feb 19, 2025

testbed:
  name: TESTBED
  servers:                <<
    terminal_server:      <<
      type: server        <<
devices:
  terminal_server:
    os: linux
    type: server 

I found adding servers under testbed makes the warnings go away

@virlos
Copy link
Collaborator

virlos commented Feb 20, 2025

This is caused by PyATS now eagerly trying to convert each proxy name from a server to a device, even if we already define it as a device in the first place and that new try block is therefore misplaced. SG may choose to raise this with unicon devs, to also fix other corner case mishandled by the new code there.

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

3 participants