Skip get_ipv6_facts if socket.has_ipv6 is false

This commit is contained in:
Stephen Fromm 2012-07-20 17:19:26 -07:00
parent 566f115a4f
commit 2d6babbd63

2
setup
View file

@ -482,6 +482,8 @@ class LinuxNetwork(Network):
self.facts[iface]['ipv4']['network'] = socket.inet_ntoa(struct.pack("!L", ip & mask)) self.facts[iface]['ipv4']['network'] = socket.inet_ntoa(struct.pack("!L", ip & mask))
def get_ipv6_facts(self): def get_ipv6_facts(self):
if not socket.has_ipv6:
return
data = get_file_content('/proc/net/if_inet6') data = get_file_content('/proc/net/if_inet6')
if data is None: if data is None:
return return