SshChecker.py only works for IPv4
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Network Administration Visualized |
Fix Released
|
Medium
|
Morten Brekkevold |
Bug Description
If your host needs to be checked on IPv6 and not IPv4, NAV cannot do SSH Check due to SshChecker.py using:
def execute(self):
s = socket.
Following patch will make it be oportunistick and pick any available protocol, perhaps there should be an option to select what protocol should be used for a certain address family instead of it being this simple.
diff --git a/SshChecker.py b/SshChecker.py
index 261a488..d208190 100644
--- a/SshChecker.py
+++ b/SshChecker.py
@@ -26,9 +26,14 @@ class SshChecker(
def __init__(self, service, **kwargs):
def execute(self):
- s = socket.
+ (s_hostname,
+ addrinfolist = socket.
+ for hostsel in addrinfolist:
+ (s_family,
+ if s_family in [socket.
+ s = socket.
- s.connect(
+ s.connect(
f = s.makefile('r+')
version = f.readline(
try:
Changed in nav: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in nav: | |
milestone: | none → 3.12.1 |
Changed in nav: | |
status: | Fix Committed → Fix Released |
Hi Anders - we do recognize that this is in deed a defect, but your patch was garbled by Launchpad, since you just pasted it into the description field. Please upload the patch as an attachment to a comment instead.