From e239fb78e07a86daee3821ccabc3e929cf5ab79f Mon Sep 17 00:00:00 2001 From: Xiao Hanyu Date: Mon, 21 Apr 2014 17:21:31 +0800 Subject: Set default auth_url from django settings when auth_url is None This is useful when users(client web forms) just provide username/password to authenticate with django_openstack_auth. In this case, they can still login if keystone version == 2.0 since keystone v2.0 only requires username/password and auth_url to authenticate. In most cases, auth_url can get from django(horizon)'s settings. Fix-bug: #1316490 Change-Id: I2ed24238adb79b6ef33e4bf20232b6a924ad0b1f --- openstack_auth/backend.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openstack_auth/backend.py b/openstack_auth/backend.py index da41cdb..3fb4ba2 100644 --- a/openstack_auth/backend.py +++ b/openstack_auth/backend.py @@ -78,6 +78,9 @@ class KeystoneBackend(object): endpoint_type = getattr( settings, 'OPENSTACK_ENDPOINT_TYPE', 'publicURL') + if auth_url is None: + auth_url = settings.OPENSTACK_KEYSTONE_URL + # keystone client v3 does not support logging in on the v2 url any more if get_keystone_version() >= 3: auth_url = auth_url.replace('v2.0', 'v3') -- cgit v1.2.1