Skip to content

Fix NIST platform builder for unparseable versions - #890

Open
NataliaPerez08 wants to merge 1 commit into
networktocode:developfrom
NataliaPerez08:fix/861-nist-dataclass-error
Open

Fix NIST platform builder for unparseable versions#890
NataliaPerez08 wants to merge 1 commit into
networktocode:developfrom
NataliaPerez08:fix/861-nist-dataclass-error

Conversation

@NataliaPerez08

Copy link
Copy Markdown

Fixes #861

version_metadata() may return a dictionary containing keys that are not
defined on the dynamically generated platform dataclass when a version cannot
be parsed.

This change filters the returned metadata to fields defined by the platform
dataclass before constructing the object.

A regression test was added for the Cisco IOS version 03.03.05SE.

Tests:

  • 809 passed
  • 10 skipped

@jeffkala

Copy link
Copy Markdown
Collaborator

@NataliaPerez08 thanks for the PR! Quick question. Is the version in the regression test actually coming out of show version or similar from an actual legacy device?

Just curious as the leading zero in the major version field is actually not following semver: https://semver.org/spec/v2.0.0.html#spec-item-2

Trying to ensure that this isn't a "made up failure" vs an actual bug.

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

Successfully merging this pull request may close these issues.

Error key from returned dict incorrectly passed as argument to dynamically created dataclass

2 participants