<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Multiple credentials in PyATS yaml file not working in Tools</title>
    <link>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322922#M3737</link>
    <description>&lt;LI-CODE lang="python"&gt;    u350-s2-17-vcsr:
        type: router
        os: iosxe
        platform: c8kv
        #alias: 'uut'
        credentials:
            default:
                username: ******
                password: ******
            ro_credentials:
                username: cisco_ro
                password: *****
            
        connections:
            credentials: ro_credentials
            cli:
                protocol: ssh
                ip: FD:192:168:53:0:9:17:4
                ssh_options: -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null&lt;/LI-CODE&gt;
&lt;P&gt;This is the error message&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;pyats.utils.exceptions.SchemaTypeError: devices.u350-s2-17-vcsr.connections.credentials:&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 21 Aug 2025 14:34:07 GMT</pubDate>
    <dc:creator>assadniang</dc:creator>
    <dc:date>2025-08-21T14:34:07Z</dc:date>
    <item>
      <title>Multiple credentials in PyATS yaml file not working</title>
      <link>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322883#M3733</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have the following configuration&lt;/P&gt;
&lt;P&gt;I have read somewhere (google AI), that you can have multiple credentials in your yaml file&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.google.com/search?q=pyats+connect+to+same+device+with+different+credentials&amp;amp;sca_esv=010046c0285134cd&amp;amp;ei=_5GmaKHTB_fIp84Py8PywQ8&amp;amp;ved=0ahUKEwjhzuzJ-pqPAxV35MkDHcuhPPgQ4dUDCBA&amp;amp;uact=5&amp;amp;oq=pyats+connect+to+same+device+with+different+credentials&amp;amp;gs_lp=Egxnd3Mtd2l6LXNlcnAiN3B5YXRzIGNvbm5lY3QgdG8gc2FtZSBkZXZpY2Ugd2l0aCBkaWZmZXJlbnQgY3JlZGVudGlhbHMyBRAhGKABMgUQIRigATIFECEYoAEyBRAhGKABMgUQIRigATIFECEYqwIyBRAhGKsCSJDTWlDc-1lYu9BacAN4AZABApgBsQOgAcJPqgELMC40MS4xMi4yLjG4AQPIAQD4AQGYAjmgAvhLwgIKEAAYsAMY1gQYR8ICCxAAGIAEGJECGIoFwgIOEC4YgAQYsQMY0QMYxwHCAgsQABiABBixAxiDAcICCxAuGIAEGNEDGMcBwgIFEAAYgATCAgoQABiABBhDGIoFwgINEAAYgAQYsQMYQxiKBcICEBAAGIAEGLEDGEMYgwEYigXCAgUQLhiABMICBhAAGBYYHsICCxAAGIAEGIYDGIoFwgIFEAAY7wXCAggQABiiBBiJBcICBRAhGJ8FmAMAiAYBkAYIkgcLMy40MS4xMS4xLjGgB8HBArIHCzAuNDEuMTEuMS4xuAfyS8IHBjIuNTQuMcgHaQ&amp;amp;sclient=gws-wiz-serp" target="_blank" rel="noopener"&gt;Google PyATS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But PyATS always uses the default credentials, even when I specify the 'ro_credentials' to use&lt;/P&gt;
&lt;PRE&gt;    u350-s2-17-vcsr:
        type: router
        os: iosxe
        platform: c8kv
        #alias: 'uut'
        credentials:
            default:
                username: ******
                password: ******
            ro_credentials:
                username: cisco_ro
                password: ******
            
        connections:
            cli:
                protocol: ssh
                ip: FD:192:168:53:0:9:17:4
                ssh_options: -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null&lt;/PRE&gt;
&lt;PRE&gt;    try:
        LOGGER.info(f"&amp;gt;&amp;gt;&amp;gt; Connecting to {device_name}...1")
        device.connect(log_stdout=False, init_config_commands=[], credentials='ro_credentials')
        LOGGER.info(f"Successfully connected to {device_name}\n")
        return device
    
    except (TimeoutError, StateMachineError, ConnectionError) as e:
        LOGGER.error(f"Failed to connect to {device_name}: {e}\n")
        return None&lt;/PRE&gt;
&lt;P&gt;Sometimes, I also get the error message:&lt;/P&gt;
&lt;PRE&gt;TypeError: function() got multiple values for keyword argument 'credentials'&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Aug 2025 13:17:43 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322883#M3733</guid>
      <dc:creator>assadniang</dc:creator>
      <dc:date>2025-08-21T13:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple credentials in PyATS yaml file not working</title>
      <link>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322886#M3734</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/407050"&gt;@assadniang&lt;/a&gt;&amp;nbsp;looking at the error you see/posted here, looks like how pyats deals with the&amp;nbsp;creds parameter in the connect() method. Try using the&amp;nbsp;via&amp;nbsp; parameter instead of credentials. This i think is the simple fix, try this and see how this works, if this does not work&amp;nbsp;If the issue might be in the YAML structure or how the testbed is being loaded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;try:
    LOGGER.info(f"&amp;gt;&amp;gt;&amp;gt; Connecting to {device_name}...1")
    device.connect(log_stdout=False, init_config_commands=[], via='ro_credentials')
    LOGGER.info(f"Successfully connected to {device_name}\n")
    return device

except (TimeoutError, StateMachineError, ConnectionError) as e:
    LOGGER.error(f"Failed to connect to {device_name}: {e}\n")
    return None&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 13:32:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322886#M3734</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2025-08-21T13:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple credentials in PyATS yaml file not working</title>
      <link>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322911#M3735</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/352839"&gt;@bigevilbeard&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I am getting this error message:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ValueError: via='ro_credentials' does not exist for device 'u350-s2-17-vcsr'&lt;/LI-CODE&gt;
&lt;P&gt;BTW, I can connect with the default credential without any issues&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 14:21:36 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322911#M3735</guid>
      <dc:creator>assadniang</dc:creator>
      <dc:date>2025-08-21T14:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple credentials in PyATS yaml file not working</title>
      <link>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322915#M3736</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/407050"&gt;@assadniang&lt;/a&gt;&amp;nbsp;under the connection in yaml file add&amp;nbsp;&lt;/P&gt;
&lt;P&gt;credentials: ro_credentials&lt;/P&gt;
&lt;P&gt;Then the python stuff from before. I think this happnes due to the expectation of cli, console..&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 14:26:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322915#M3736</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2025-08-21T14:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple credentials in PyATS yaml file not working</title>
      <link>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322922#M3737</link>
      <description>&lt;LI-CODE lang="python"&gt;    u350-s2-17-vcsr:
        type: router
        os: iosxe
        platform: c8kv
        #alias: 'uut'
        credentials:
            default:
                username: ******
                password: ******
            ro_credentials:
                username: cisco_ro
                password: *****
            
        connections:
            credentials: ro_credentials
            cli:
                protocol: ssh
                ip: FD:192:168:53:0:9:17:4
                ssh_options: -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null&lt;/LI-CODE&gt;
&lt;P&gt;This is the error message&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;pyats.utils.exceptions.SchemaTypeError: devices.u350-s2-17-vcsr.connections.credentials:&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Aug 2025 14:34:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322922#M3737</guid>
      <dc:creator>assadniang</dc:creator>
      <dc:date>2025-08-21T14:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple credentials in PyATS yaml file not working</title>
      <link>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322924#M3738</link>
      <description>&lt;P&gt;Sorry this is my bad.&amp;nbsp; ro_credentials at the wrong indentation level, try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;u350-s2-17-vcsr:
    type: router
    os: iosxe
    platform: c8kv
    #alias: 'uut'
    credentials:
        default:
            username: ******
            password: ******
        ro_credentials:
            username: cisco_ro
            password: *****

    connections:
        cli:
            protocol: ssh
            ip: FD:192:168:53:0:9:17:4
            ssh_options: -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
            credentials: ro_credentials&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Your credentials parameter should be specified within the individual connection definition (cli in this case)&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 14:40:04 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322924#M3738</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2025-08-21T14:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple credentials in PyATS yaml file not working</title>
      <link>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322941#M3739</link>
      <description>&lt;P&gt;Still not working...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    u350-s2-17-vcsr:
        type: router
        os: iosxe
        platform: c8kv
        #alias: 'uut'
        credentials:
            default:
                username: *****
                password: *****
            ro_credentials:
                username: cisco_ro
                password: ********           
        connections:
            cli:
                protocol: ssh
                ip: FD:192:168:53:0:9:17:4
                ssh_options: -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
                credentials: ro_credentials&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;pyats.utils.exceptions.SchemaTypeError: devices.u350-s2-17-vcsr.connections.cli.credentials:&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Aug 2025 14:59:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322941#M3739</guid>
      <dc:creator>assadniang</dc:creator>
      <dc:date>2025-08-21T14:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple credentials in PyATS yaml file not working</title>
      <link>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322973#M3740</link>
      <description>&lt;P&gt;Hmmmm ... out on a limb here now .. so try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;u350-s2-17-vcsr:
    type: router
    os: iosxe
    platform: c8kv
    credentials:
        default:
            username: *****
            password: *****
        ro_credentials:
            username: cisco_ro
            password: ********
    connections:
        cli:
            protocol: ssh
            ip: FD:192:168:53:0:9:17:4
            ssh_options: -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
        ro_cli:
            protocol: ssh
            ip: FD:192:168:53:0:9:17:4
            ssh_options: -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
            via: ro_credentials&lt;/LI-CODE&gt;
&lt;P&gt;In python use&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;device.connect(alias='ro_cli', log_stdout=False, init_config_commands=[])&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Aug 2025 16:17:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/multiple-credentials-in-pyats-yaml-file-not-working/m-p/5322973#M3740</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2025-08-21T16:17:35Z</dc:date>
    </item>
  </channel>
</rss>

