Fix determining if IPv6 is supported when it's disabled

On systems where IPv6 is completly disabled there can be
AttributeError when shade tries to determine if IPv6 is
supported or not on local system.
Now it's fixed by returning False always when AF_INET6
isn't available in netifaces.

Change-Id: I45138bd42cb63ff59b6aed85f33da11aab43aaba
Related-Bug: #2001001
This commit is contained in:
Sławek Kapłoński 2017-08-16 20:36:01 +00:00
parent b92697b1a3
commit 89e07d905a

View File

@ -259,7 +259,10 @@ def localhost_supports_ipv6():
IPv6 connectivity.
"""
return netifaces.AF_INET6 in netifaces.gateways()['default']
try:
return netifaces.AF_INET6 in netifaces.gateways()['default']
except AttributeError:
return False
def normalize_users(users):