From 89e07d905a94525a0813e6e467da9f5cd94a1c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awek=20Kap=C5=82o=C5=84ski?= Date: Wed, 16 Aug 2017 20:36:01 +0000 Subject: [PATCH] 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 --- shade/_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shade/_utils.py b/shade/_utils.py index bf8abd6f7..bd57a3fdf 100644 --- a/shade/_utils.py +++ b/shade/_utils.py @@ -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):