question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pyats.utils.exception : Missing keys when a test playbook ran against sbx

See original GitHub issue

Having issues running a test playbook (with genie learn arp module) and the following exception returned:

 pyats.utils.exceptions.SchemaMissingKeyError: Missing keys:
      "connections"  parent: [devices.sbx-nxos-mgmt.cisco.com]
      "type"  parent: [devices.sbx-nxos-mgmt.cisco.com]

As it was advised by clay584/genie_collection here: https://github.com/clay584/genie_collection/issues/6#issuecomment-804088289 this seems to be an issues with the parser.

The full output can be found below:

(.venv) [root@292c4c38a3f8 genie_collection-master]# pwd
/genie_collection-master
(.venv) [root@292c4c38a3f8 genie_collection-master]# tree
.
|-- LICENSE
|-- NOTICE
|-- Pipfile
|-- Pipfile.lock
|-- README.md
|-- ansible.cfg
|-- clay584
|   `-- genie
|       |-- README.md
|       |-- clay584-genie-0.1.7.tar.gz
|       |-- colored_diff.png
|       |-- galaxy.yml
|       |-- learn_genie_params.png
|       `-- plugins
|           |-- filter
|           |   `-- parse_genie.py
|           `-- modules
|               |-- args.json
|               `-- learn_genie.py
|-- genie_filter_testing.yml
|-- inventory
|-- test.yml
|-- test_arp.yaml
-- yamllint_config.yml
5 directories, 19 files
(.venv) [root@292c4c38a3f8 genie_collection-master]# cat test_arp.yaml
---
- hosts: all
  gather_facts: false
  connection: local
  collections:
   - clay584.genie
  tasks:
    - name: Learn Genie - ARP
      learn_genie:
        host: "{{ ansible_host }}"
        port: 8181
        protocol: ssh
        username: admin
        password: Admin_1234!
        os: nxos
        feature: arp
      register: genie_arp1
    - name: Debug Genie
      debug:
        msg: "{{ genie_arp1 }}"
(.venv) [root@292c4c38a3f8 genie_collection-master]# ansible --version
ansible 2.10.6
  config file = /genie_collection-master/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules', '/genie_collection-master/clay584/genie/plugins/modules']
  ansible python module location = /.venv/lib64/python3.6/site-packages/ansible
  executable location = /.venv/bin/ansible
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
(.venv) [root@292c4c38a3f8 genie_collection-master]# cat inventory
all:
  hosts:
    sbx-nxos-mgmt.cisco.com:
      ansible_connection: local
      ansible_python_interpreter: "{{ ansible_playbook_python }}"
(.venv) [root@292c4c38a3f8 genie_collection-master]# ansible-playbook test_arp.yaml -i inventory -v
Using /genie_collection-master/ansible.cfg as config file

PLAY [all] ************************************************************************************************************************************************************

TASK [Learn Genie - ARP] **********************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was:   "connections"  parent: [devices.sbx-nxos-mgmt.cisco.com]
fatal: [sbx-nxos-mgmt.cisco.com]: FAILED! => changed=false
  module_stderr: |-
    Traceback (most recent call last):
      File "/root/.ansible/tmp/ansible-tmp-1615507860.465231-957-197841320397725/AnsiballZ_learn_genie.py", line 102, in <module>
        _ansiballz_main()
      File "/root/.ansible/tmp/ansible-tmp-1615507860.465231-957-197841320397725/AnsiballZ_learn_genie.py", line 94, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/root/.ansible/tmp/ansible-tmp-1615507860.465231-957-197841320397725/AnsiballZ_learn_genie.py", line 40, in invoke_module
        runpy.run_module(mod_name='ansible_collections.clay584.genie.plugins.modules.learn_genie', init_globals=None, run_name='__main__', alter_sys=True)
      File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
        mod_name, mod_spec, pkg_name, script_name)
      File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_learn_genie_payload_s18eg0q9/ansible_learn_genie_payload.zip/ansible_collections/clay584/genie/plugins/modules/learn_genie.py", line 367, in <module>
      File "/tmp/ansible_learn_genie_payload_s18eg0q9/ansible_learn_genie_payload.zip/ansible_collections/clay584/genie/plugins/modules/learn_genie.py", line 363, in main
      File "/tmp/ansible_learn_genie_payload_s18eg0q9/ansible_learn_genie_payload.zip/ansible_collections/clay584/genie/plugins/modules/learn_genie.py", line 296, in run_module
      File "src/genie/testbed.py", line 4, in genie.testbed.load
      File "src/genie/conf/main.py", line 81, in genie.conf.main.Genie.init
      File "/.venv/lib64/python3.6/site-packages/pyats/topology/loader/__init__.py", line 41, in load
        return TestbedFileLoader(**init_kwargs).load(loadable, **kwargs)
      File "src/pyats/utils/yaml/loader.py", line 134, in pyats.utils.yaml.loader.Loader.load
      File "src/pyats/utils/schemaengine.py", line 403, in pyats.utils.schemaengine.Schema.validate
    pyats.utils.exceptions.SchemaMissingKeyError: Missing keys:
      "type"  parent: [devices.sbx-nxos-mgmt.cisco.com]
      "connections"  parent: [devices.sbx-nxos-mgmt.cisco.com]
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

PLAY RECAP ************************************************************************************************************************************************************
sbx-nxos-mgmt.cisco.com    : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
danielgrazianocommented, Apr 8, 2021

@bronitskiy just an update, I should be releasing a new package today with the fix.

1reaction
danielgrazianocommented, Mar 31, 2021

@clay584 Sorry I deleted my previous comment as this seems to be an issue on our side. Looking into it further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pyats.utils package — pyATS Documentation - DevNet
If exact key/value match is found, they're excluded to avoid redundant information. Parameters. source_dict (dict) – keys in this dictionary are compared ...
Read more >
Getting Started with pyATS (and Genie) - Cisco Developer
PyATS is a python framework to help you test your network! Like, actual functional testing!!
Read more >
Simple index - piwheels
... micropython-gnssl76l duhdoy carla-utils imapmail-mod d8s-pdfs legos-apod dns-eco zcore p0f micropython-sqlite3 pycel zezfio fact-test-001 fortran-binary ...
Read more >
First steps with pyATS - AboutNetworks.net
Here are my first steps with pyATS and GENIE: Network Test & Automation ... The “home” of pyATS is located on the Cisco...
Read more >
Parsing Strategies - PyATS Genie Parsers | The NTC Mag
Parser class: This class defines the actual parsing methods for the specific command. One key difference between what we've covered so far and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found