-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add host with ipv6 #75
Conversation
reverts: #62, reason in commit msg |
Current coverage is 74.75% (diff: 90.00%)@@ master #75 diff @@
==========================================
Files 16 16
Lines 1438 1454 +16
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 1067 1087 +20
+ Misses 371 367 -4
Partials 0 0
|
Looks good to me 👍 @myakove can you take a look at it? |
:return: IP or None | ||
:rtype: string or None | ||
""" | ||
out = self._cmd(["ip", "addr", "show", interface]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use -6 here too
ip -6 addr show
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
default_gw = re.findall( | ||
r'(?<=\s)[0-9a-fA-F:]{3,}(?=\s)', i | ||
) | ||
if netaddr.valid_ipv6(default_gw[0]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this check since we get the IP from ip -6 command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to keep it there, if the regex fails to match the address correctly.
You can add host using ipv6 Always try to resolve FQDN. Before if you created host with domain name but not fully qualified it was stored as fqdn Add ability to find default ipv6 for gateway. Add ability to find ipv6 by interface
You can add host using ipv6
Always try to resolve FQDN. Before if you created host
with domain name but not fully qualified it was stored
as fqdn
Add ability to find default ipv6 for gateway.
Add ability to find ipv6 by interface
fixes: #56