Skip to content
Browse files

f5: handle IPv6 virtual servers

  • Loading branch information...
1 parent e855dd2 commit c0ea90253f02e361337044ccdef0a72fb18737d0 @vincentbernat committed Mar 30, 2012
Showing with 10 additions and 4 deletions.
  1. +10 −4 qcss3/collector/loadbalancer/f5ltm.py
View
14 qcss3/collector/loadbalancer/f5ltm.py
@@ -190,8 +190,8 @@ def process_vs(self, v, httpclass):
c.getResult()
# No IPv6 virtual server
- if self.cache(('ltmVirtualServAddrType', ov)) != 1:
- log.msg("In %r, unable to handle IPv6 virtual server %s, skip it" % (self.lb.name, v))
+ if self.cache(('ltmVirtualServAddrType', ov)) not in [1, 2]:
+ log.msg("In %r, unknown address type for virtual server %s, skip it" % (self.lb.name, v))
yield None
return
@@ -222,8 +222,14 @@ def process_vs(self, v, httpclass):
yield c
c.getResult()
- vip = "%s:%d" % (socket.inet_ntoa(self.cache(('ltmVirtualServAddr', ov))),
- self.cache(('ltmVirtualServPort', ov)))
+ if self.cache(('ltmVirtualServAddrType', ov)) == 1:
+ vip = "%s:%d" % (socket.inet_ntop(socket.AF_INET,
+ self.cache(('ltmVirtualServAddr', ov))),
+ self.cache(('ltmVirtualServPort', ov)))
+ else:
+ vip = "[%s]:%d" % (socket.inet_ntop(socket.AF_INET6,
+ self.cache(('ltmVirtualServAddr', ov))),
+ self.cache(('ltmVirtualServPort', ov)))
protocol = defer.waitForDeferred(self.get_protocol(ov))
yield protocol
protocol = protocol.getResult()

0 comments on commit c0ea902

Please sign in to comment.
Something went wrong with that request. Please try again.