Skip to content

Fail to import device types when specifying slugs #137

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

Closed
BorisBachere opened this issue May 28, 2024 · 5 comments
Closed

Fail to import device types when specifying slugs #137

BorisBachere opened this issue May 28, 2024 · 5 comments

Comments

@BorisBachere
Copy link

Example extracted from .env:

SLUGS=cisco-n9k-c93360yc-fx2
VENDORS=Cisco

Below error appends:

Traceback (most recent call last):
  File "/home/bbacspy8/projects2/Device-Type-Library-Import/./nb-dt-import.py", line 54, in <module>
    main()
  File "/home/bbacspy8/projects2/Device-Type-Library-Import/./nb-dt-import.py", line 32, in main
    module_types = settings.dtl_repo.parse_files(files, slugs=args.slugs)
  File "/home/bbacspy8/projects2/Device-Type-Library-Import/repo.py", line 111, in parse_files
    if slugs and True not in [
  File "/home/bbacspy8/projects2/Device-Type-Library-Import/repo.py", line 112, in <listcomp>
    True if s.casefold() in data["slug"].casefold() else False for s in slugs
KeyError: 'slug'
@jonkerj
Copy link

jonkerj commented Oct 29, 2024

The code seems to assume module type YAML files have a key slug. If you comment out the part where module types are imported, it does not crash on this.

@danner26
Copy link
Member

All files should have a slug, can you point me to one that does not?

@BorisBachere
Copy link
Author

Actually the issue is that no file exists for N9K-C93360YC-FX2.
I created it on pull #2435

@jonkerj
Copy link

jonkerj commented Oct 30, 2024

All files should have a slug, can you point me to one that does not?

modules-types/ZTE/PRWH.yaml

@danner26
Copy link
Member

All files should have a slug, can you point me to one that does not?

modules-types/ZTE/PRWH.yaml

Sorry about that, was speaking about the device-types. You are correct, modules do not have slugs generally

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