From 0ea1f07993d9612df95843b99e7a16478d35086e Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Thu, 23 Oct 2014 19:48:45 -0500 Subject: [PATCH] Remove netaddr package requirement An auth_host with : in the name is going to require wrapping in [] because otherwise the : is confused with the port separator, so the code doesn't have to verify that it's an IPv6 address. This allows the removal of the netaddr package requirement. Change-Id: I0d4c622b360769f1a7587d3c230e50d22f5b75a4 --- keystonemiddleware/auth_token.py | 3 +-- requirements.txt | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/keystonemiddleware/auth_token.py b/keystonemiddleware/auth_token.py index cbb5c635..0ebef5ef 100644 --- a/keystonemiddleware/auth_token.py +++ b/keystonemiddleware/auth_token.py @@ -175,7 +175,6 @@ from keystoneclient.auth import token_endpoint from keystoneclient.common import cms from keystoneclient import exceptions from keystoneclient import session -import netaddr from oslo.config import cfg from oslo.serialization import jsonutils from oslo.utils import timeutils @@ -605,7 +604,7 @@ class AuthProtocol(object): auth_protocol = self._conf_get('auth_protocol') auth_admin_prefix = self._conf_get('auth_admin_prefix') - if netaddr.valid_ipv6(auth_host): + if ':' in auth_host: # Note(dzyu) it is an IPv6 address, so it needs to be wrapped # with '[]' to generate a valid IPv6 URL, based on # http://www.ietf.org/rfc/rfc2732.txt diff --git a/requirements.txt b/requirements.txt index 4de4e16e..91edca02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,6 @@ Babel>=1.3 iso8601>=0.1.9 -netaddr>=0.7.12 oslo.config>=1.4.0 # Apache-2.0 oslo.serialization>=1.0.0 # Apache-2.0 oslo.utils>=1.0.0 # Apache-2.0