Hello community,

here is the log from the commit of package python-django_openstack_auth for 
openSUSE:Factory checked in at 2013-01-30 11:18:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django_openstack_auth (Old)
 and      /work/SRC/openSUSE:Factory/.python-django_openstack_auth.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-django_openstack_auth", Maintainer is ""

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-django_openstack_auth/python-django_openstack_auth.changes
        2013-01-17 09:58:22.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-django_openstack_auth.new/python-django_openstack_auth.changes
   2013-01-30 11:18:47.000000000 +0100
@@ -1,0 +2,8 @@
+Tue Jan 29 08:17:22 UTC 2013 - [email protected]
+
+- Update to version 1.0.6:
+  + Fix compatibility with keystoneclient v0.2.
+- Changes from version 1.0.5:
+  + Improves error handling; fixes failing test.
+
+-------------------------------------------------------------------

Old:
----
  django_openstack_auth-1.0.4.tar.gz

New:
----
  django_openstack_auth-1.0.6.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-django_openstack_auth.spec ++++++
--- /var/tmp/diff_new_pack.VVJu4m/_old  2013-01-30 11:18:48.000000000 +0100
+++ /var/tmp/diff_new_pack.VVJu4m/_new  2013-01-30 11:18:48.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-django_openstack_auth
 #
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -13,18 +13,19 @@
 # published by the Open Source Initiative.
 
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
 
 
 Name:           python-django_openstack_auth
-Version:        1.0.4
+Version:        1.0.6
 Release:        0
-License:        BSD-3-Clause
 Summary:        A Django auth backend for use with the OpenStack Keystone
-Url:            http://django_openstack_auth.readthedocs.org/
+License:        BSD-3-Clause
 Group:          Development/Languages/Python
+Url:            http://django_openstack_auth.readthedocs.org/
 Source:         
http://pypi.python.org/packages/source/d/django_openstack_auth/django_openstack_auth-%{version}.tar.gz
-BuildRequires:  python-devel
 BuildRequires:  python-Sphinx
+BuildRequires:  python-devel
 BuildRequires:  python-django
 BuildRequires:  python-keystoneclient
 BuildRequires:  python-mox

++++++ django_openstack_auth-1.0.4.tar.gz -> django_openstack_auth-1.0.6.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_openstack_auth-1.0.4/PKG-INFO 
new/django_openstack_auth-1.0.6/PKG-INFO
--- old/django_openstack_auth-1.0.4/PKG-INFO    2012-11-16 20:53:10.000000000 
+0100
+++ new/django_openstack_auth-1.0.6/PKG-INFO    2012-12-10 04:51:01.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django_openstack_auth
-Version: 1.0.4
+Version: 1.0.6
 Summary: A Django authentication backend for use with the OpenStack Keystone 
Identity backend.
 Home-page: http://django_openstack_auth.readthedocs.org/
 Author: Gabriel Hurley
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_openstack_auth-1.0.4/django_openstack_auth.egg-info/PKG-INFO 
new/django_openstack_auth-1.0.6/django_openstack_auth.egg-info/PKG-INFO
--- old/django_openstack_auth-1.0.4/django_openstack_auth.egg-info/PKG-INFO     
2012-11-16 20:53:10.000000000 +0100
+++ new/django_openstack_auth-1.0.6/django_openstack_auth.egg-info/PKG-INFO     
2012-12-10 04:51:01.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django-openstack-auth
-Version: 1.0.4
+Version: 1.0.6
 Summary: A Django authentication backend for use with the OpenStack Keystone 
Identity backend.
 Home-page: http://django_openstack_auth.readthedocs.org/
 Author: Gabriel Hurley
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_openstack_auth-1.0.4/django_openstack_auth.egg-info/requires.txt 
new/django_openstack_auth-1.0.6/django_openstack_auth.egg-info/requires.txt
--- old/django_openstack_auth-1.0.4/django_openstack_auth.egg-info/requires.txt 
2012-11-16 20:53:10.000000000 +0100
+++ new/django_openstack_auth-1.0.6/django_openstack_auth.egg-info/requires.txt 
2012-12-10 04:51:01.000000000 +0100
@@ -1,2 +1,2 @@
 django >= 1.4
-python-keystoneclient
\ No newline at end of file
+python-keystoneclient >= 0.2
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_openstack_auth-1.0.4/openstack_auth/__init__.py 
new/django_openstack_auth-1.0.6/openstack_auth/__init__.py
--- old/django_openstack_auth-1.0.4/openstack_auth/__init__.py  2012-11-16 
20:52:38.000000000 +0100
+++ new/django_openstack_auth-1.0.6/openstack_auth/__init__.py  2012-12-10 
04:28:09.000000000 +0100
@@ -1,2 +1,2 @@
 # following PEP 386
-__version__ = "1.0.4"
+__version__ = "1.0.6"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_openstack_auth-1.0.4/openstack_auth/backend.py 
new/django_openstack_auth-1.0.6/openstack_auth/backend.py
--- old/django_openstack_auth-1.0.4/openstack_auth/backend.py   2012-11-16 
20:40:55.000000000 +0100
+++ new/django_openstack_auth-1.0.6/openstack_auth/backend.py   2012-12-10 
04:43:19.000000000 +0100
@@ -66,7 +66,9 @@
             unscoped_token = Token(TokenManager(None),
                                    unscoped_token_data,
                                    loaded=True)
-        except keystone_exceptions.Unauthorized:
+        except (keystone_exceptions.Unauthorized,
+                keystone_exceptions.Forbidden,
+                keystone_exceptions.NotFound):
             msg = _('Invalid user name or password.')
             raise KeystoneAuthException(msg)
         except (keystone_exceptions.ClientException,
@@ -95,6 +97,9 @@
         while tenants:
             tenant = tenants.pop()
             try:
+                client = keystone_client.Client(tenant_id=tenant.id,
+                                                token=unscoped_token.id,
+                                                auth_url=auth_url)
                 token = client.tokens.authenticate(username=username,
                                                    token=unscoped_token.id,
                                                    tenant_id=tenant.id)
@@ -111,7 +116,9 @@
         self.check_auth_expiry(token)
 
         # If we made it here we succeeded. Create our User!
-        user = create_user_from_token(request, token, client.management_url)
+        user = create_user_from_token(request,
+                                      token,
+                                      client.service_catalog.url_for())
 
         if request is not None:
             if is_ans1_token(unscoped_token.id):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_openstack_auth-1.0.4/openstack_auth/tests/tests.py 
new/django_openstack_auth-1.0.6/openstack_auth/tests/tests.py
--- old/django_openstack_auth-1.0.4/openstack_auth/tests/tests.py       
2012-07-03 11:18:53.000000000 +0200
+++ new/django_openstack_auth-1.0.6/openstack_auth/tests/tests.py       
2012-12-10 04:49:01.000000000 +0100
@@ -41,6 +41,10 @@
                       username=user.name,
                       tenant_id=None).AndReturn(self.keystone_client)
         self.keystone_client.tenants.list().AndReturn(tenants)
+        client.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                      tenant_id=self.data.tenant_two.id,
+                      token=sc.get_token()['id']) \
+                .AndReturn(self.keystone_client)
         self.keystone_client.tokens.authenticate(tenant_id=tenants[1].id,
                                                  token=sc.get_token()['id'],
                                                  username=user.name) \
@@ -172,7 +176,12 @@
                                                  username=user.name) \
                             .AndReturn(scoped)
 
-        client.Client(endpoint=settings.OPENSTACK_KEYSTONE_URL) \
+        client.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                      tenant_id=self.data.tenant_two.id,
+                      token=sc.get_token()['id']) \
+                .AndReturn(self.keystone_client)
+
+        client.Client(endpoint=sc.url_for()) \
                 .AndReturn(self.keystone_client)
 
         self.keystone_client.tokens.authenticate(tenant_id=tenant.id,
@@ -198,5 +207,5 @@
         response = self.client.get(url, form_data)
 
         self.assertRedirects(response, settings.LOGIN_REDIRECT_URL)
-        self.assertEqual(self.client.session['tenant_id'],
+        self.assertEqual(self.client.session['token']['token']['tenant']['id'],
                          scoped.tenant['id'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_openstack_auth-1.0.4/openstack_auth/user.py 
new/django_openstack_auth-1.0.6/openstack_auth/user.py
--- old/django_openstack_auth-1.0.4/openstack_auth/user.py      2012-11-16 
20:49:47.000000000 +0100
+++ new/django_openstack_auth-1.0.6/openstack_auth/user.py      2012-12-10 
04:38:58.000000000 +0100
@@ -1,4 +1,5 @@
 import hashlib
+import logging
 
 from django.contrib.auth.models import AnonymousUser
 
@@ -8,6 +9,9 @@
 from .utils import check_token_expiration, is_ans1_token
 
 
+LOG = logging.getLogger(__name__)
+
+
 def set_session_from_user(request, user):
     if is_ans1_token(user.token.id):
         hashed_token = hashlib.md5(user.token.id).hexdigest()
@@ -117,11 +121,10 @@
                 client = keystone_client.Client(username=self.username,
                                                 auth_url=endpoint,
                                                 token=token.id)
-                authd = client.tenants.list()
+                self._authorized_tenants = client.tenants.list()
             except (keystone_exceptions.ClientException,
                     keystone_exceptions.AuthorizationFailure):
-                authd = []
-            self._authorized_tenants = authd
+                LOG.exception('Unable to retrieve tenant list.')
         return self._authorized_tenants or []
 
     @authorized_tenants.setter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_openstack_auth-1.0.4/openstack_auth/views.py 
new/django_openstack_auth-1.0.6/openstack_auth/views.py
--- old/django_openstack_auth-1.0.4/openstack_auth/views.py     2012-08-20 
23:40:14.000000000 +0200
+++ new/django_openstack_auth-1.0.6/openstack_auth/views.py     2012-12-10 
04:50:04.000000000 +0100
@@ -12,6 +12,7 @@
 from django.views.decorators.csrf import csrf_protect
 
 from keystoneclient.v2_0 import client as keystone_client
+from keystoneclient import exceptions as keystone_exceptions
 
 from .forms import Login
 from .user import set_session_from_user, create_user_from_token
@@ -54,8 +55,9 @@
     # will erase it if we set it earlier.
     if request.user.is_authenticated():
         set_session_from_user(request, request.user)
+        regions = dict(Login.get_region_choices())
         region = request.user.endpoint
-        region_name = dict(Login.get_region_choices()).get(region)
+        region_name = regions.get(region)
         request.session['region_endpoint'] = region
         request.session['region_name'] = region_name
     return res
@@ -73,8 +75,13 @@
               % (tenant_id, request.user.username))
     endpoint = request.user.endpoint
     client = keystone_client.Client(endpoint=endpoint)
-    token = client.tokens.authenticate(tenant_id=tenant_id,
-                                       token=request.user.token.id)
-    user = create_user_from_token(request, token, endpoint)
-    set_session_from_user(request, user)
+    try:
+        token = client.tokens.authenticate(tenant_id=tenant_id,
+                                        token=request.user.token.id)
+    except keystone_exceptions.ClientException:
+        token = None
+        LOG.exception('An error occurred while switching sessions.')
+    if token:
+        user = create_user_from_token(request, token, endpoint)
+        set_session_from_user(request, user)
     return shortcuts.redirect(settings.LOGIN_REDIRECT_URL)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_openstack_auth-1.0.4/setup.py 
new/django_openstack_auth-1.0.6/setup.py
--- old/django_openstack_auth-1.0.4/setup.py    2012-07-03 11:24:52.000000000 
+0200
+++ new/django_openstack_auth-1.0.6/setup.py    2012-12-10 04:21:06.000000000 
+0100
@@ -43,7 +43,7 @@
     zip_safe=False,
     install_requires=[
         'django >= 1.4',
-        'python-keystoneclient'
+        'python-keystoneclient >= 0.2'
     ],
     tests_require=[
         'mox',

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to