Skip to content
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

No method to get interface IP address returns a reliable type #296

Open
nbastin opened this issue Mar 18, 2024 · 1 comment
Open

No method to get interface IP address returns a reliable type #296

nbastin opened this issue Mar 18, 2024 · 1 comment
Assignees

Comments

@nbastin
Copy link

nbastin commented Mar 18, 2024

Interface.get_ip_addr_ssh claims to return a string, but might return a list or dictionary.

Interface.get_ip_addr has an undocumented return, and ostensibly could return either an ip_address object or a string (falling back to get_ip_addr_ssh), but realistically could return any python object, since there's no gatekeeping on the contents of fablib_data[self.ADDR].

Interface.get_ips returns a list of anything, although oddly it often returns an empty list, even when the other methods work.

This means that a client either has to implement a rich type-inspection-and-handling regime, or more realistically, just ignore Interface and Node and implement everything themselves.

@sajith sajith self-assigned this Apr 9, 2024
@sajith
Copy link
Member

sajith commented Apr 9, 2024

From a quick look, get_ip_addr_ssh() seems to contain some institutional knowledge that I do not have. Will ask around.

Also it sounds like it might be a good idea to run mypy against fablib. mypy fabrictestbed_extensions/fablib/interface.py do report several issues.

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

2 participants