cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Who Me Too'd this topic

pyATS genie cannot connect via ssh

boesch
Level 1
Level 1

Hi,

Just started to play around with pyATS and genie.

But I cannot connect to the switch via ssh.

 

My testbed.yml file looks like this:

devices:
  as-test2:
    connections:
      vty:
        ip: 172.21.31.6
        protocol: ssh
    credentials:
      default:
        password: '%ASK{}'
        username: chris
    os: iosxe
    type: iosxe
    series: cat9k
    platform: cat9k

Then I try to parse "show version" and the connect fails:

./bin/genie -vvv parse "show version" --testbed-file testbed.yml 
loading yaml file /Users/cb/networking/genie/testbed.yml
Deriving testbed name ...
Enter default password for device as-test2: 
Using a default key as pyATS configuration under [secrets] string.key was not specified.
Using a default key as pyATS configuration under [secrets] string.key was not specified.
Credential credentials not found, trying default ...
Credential credentials not found, trying default ...

2020-10-08 11:04:33,535: %UNICON-INFO: +++ as-test2 logfile /tmp/as-test2-cli-20201008T110433535.log +++

2020-10-08 11:04:33,536: %UNICON-INFO: +++ Unicon plugin iosxe/cat9k +++
Connection closed by 172.21.31.6 port 22


2020-10-08 11:04:42,574: %UNICON-INFO: +++ connection to spawn: ssh -l chris 172.21.31.6, id: 4682891904 +++

2020-10-08 11:04:42,574: %UNICON-INFO: connection to as-test2
  0%|                                                                                                                                                                             | 0/1 [00:00<?, ?it/s]Issue with the parser show version


Traceback (most recent call last):
  File "src/genie/cli/commands/parser.py", line 339, in genie.cli.commands.parser.ParserCommand.parse
  File "src/genie/conf/base/device.py", line 551, in genie.conf.base.device.Device.parse
  File "src/genie/conf/base/device.py", line 582, in genie.conf.base.device.Device._get_parser_output
TypeError: device is not connected, output must be provided.
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  2.30it/s]

ssh access in general is working via terminal, and also username and password are correct.

In syslog it generates messages:

%SEC_LOGIN-4-LOGIN_FAILED: Login failed [user: Invalid-Credentials] [Source: 172.23.8.241] [localport: 22] [Reason: Login Authentication Failed]

Has someone an idea what could be the reason.

Kind regards, Christian

Who Me Too'd this topic