02-17-2025 09:30 AM
Hostname: DUT1(Master:1)
Hi team. I've run into a problem, as you can see above - when trying to connect with this hostname, I get an error because the hostname doesn't match the prompt. Is there any way to change the prompt, or another way to solve this problem? (Changing the hostname is not possible, because when the switches are stacked, this suffix appears and i can`t remove it on my system).
02-17-2025 10:22 PM
Hi @Dombre
Could you please share with us your testbed file? What's the platform/hardware name for destination device you want to connect to?
02-18-2025 12:48 AM
Without looking at your testbed could be a hostname mismatch between what you have on your testbed and the hostname of your device.
The name of the device in your testbed, and the hostname MUST match. It’s case sensitive. In case it doesn’t match, you will have a similar error.
unicon.core.errors.TimeoutError: Prompt timeout occured, please check the hostname
You can also specify in your Python script that you do not care if they don’t match by setting the
learn_hostname
argument toTrue
in your deviceconnect()
method.device.connect(learn_hostname=True)
As always full tracebacks are good to check erros, and better if they are text based so is easier to parse them.
02-18-2025 12:58 AM - edited 02-18-2025 01:40 AM
my hostname is DUT1, but in CLI when the switch is stacked its «DUT1(Master:1)» so connect function can’t see the hostname.
I tried changing hostname in testbed, but it is useless because the connect function cant even read the hostname from the CLI, its in the buffer
02-18-2025 03:09 AM
@Dombre
What's the platform/hardware of the stacked switch you want to connect to?
02-18-2025 04:29 AM
@mfr-6 its my own iosxe-like os
02-18-2025 05:05 AM
@Dombre - the prompt i see coming from your device looks like HP/Aruba-like device, or something similar. I'm afraid it's not supported by Unicon, the framework that deals with creating connections to devices, used by pyATS.
Please see the list of supported devices here: https://pubhub.devnetcloud.com/media/unicon/docs/user_guide/supported_platforms.html#
02-18-2025 05:24 AM
@mfr-6 i can connect to devices, everything works except this device that is stacked (it connects but then the command are not sent)
02-18-2025 10:26 PM - edited 02-18-2025 10:33 PM
@Dombre yes, I see your struggle and the problem is that your device is not fully supported under certain conditions (in your case - once device is stacked) and that's because your device requires special prompt handling, but since unicon doesn't support that, it doesn't know how to handle prompt that includes "(Master:1)".
The reason why it works with a switches not being stacked is because CLI interface is pretty much the same as iosxe one and as long as there are no discrepancies, all works good as all patterns of ios-xe are matched.
I see this is important for you, so what about addressing your issue directly to the team who is responsible for pyATS? Drop them an email and include a link to this conversation, so they'll better understand what's the issue about.
Here's the contact info to pyATS team: pyats-support-ext@cisco.com
pyATS is available for everyone for free, but it's closed-source, meaning that community cannot make adjustments to the code to add support for new device types - that's why issues like this need to be addressed to the team who's in charge of pyATS.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide