File 0001-Properly-authenticate-against-Keystone-V2-in-a-V3-en.patch of Package python-novaclient

From 4a9a88e251e81c2372ff08db54f96419fb0e2823 Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dirk@dmllr.de>
Date: Thu, 7 Jan 2016 14:18:15 +0100
Subject: [PATCH] Properly authenticate against Keystone V2 in a V3 env

When OS_AUTH_URL points to a /v3 URL, the logic tried to
do a keystone v1 authentication which is not going to succeed.
Treat v3 as v2.0 for now.

Change-Id: Ic3b442d2b841bfc7cab2ad6b972c03d7a9435e2e
---
 novaclient/client.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Index: python-novaclient-2.30.1/novaclient/client.py
===================================================================
--- python-novaclient-2.30.1.orig/novaclient/client.py
+++ python-novaclient-2.30.1/novaclient/client.py
@@ -542,13 +542,19 @@ class HTTPClient(object):
             self._save_keys()
             return
 
+        auth_url = self.auth_url
+        # TODO(dmllr): Properly support Keystone V3. For now, fallback to V2
+        if self.version == "v3":
+            # Construct v2 auth_url
+            auth_url = auth_url.replace('/v3', '/v2.0')
+            self.version = 'v2.0'
+
         # TODO(sandy): Assume admin endpoint is 35357 for now.
         # Ideally this is going to have to be provided by the service catalog.
         new_netloc = netloc.replace(':%d' % port, ':%d' % (35357,))
         admin_url = parse.urlunsplit(
             (scheme, new_netloc, path, query, frag))
 
-        auth_url = self.auth_url
         if self.version == "v2.0":  # FIXME(chris): This should be better.
             while auth_url:
                 if not self.auth_system or self.auth_system == 'keystone':
openSUSE Build Service is sponsored by