Add user_info and user_term for bw compatibility
authorStavros Sachtouris <saxtouri@admin.grnet.gr>
Mon, 13 Jan 2014 15:18:50 +0000 (17:18 +0200)
committerStavros Sachtouris <saxtouri@admin.grnet.gr>
Mon, 13 Jan 2014 15:18:50 +0000 (17:18 +0200)
Refs: #4880

docs/developers/clients-api.rst
kamaki/clients/astakos/__init__.py

index 2281f4e..71ea048 100644 (file)
@@ -288,7 +288,7 @@ Register a banch of pre-uploaded images
     IMAGE_CONTAINER = 'images'
 
     astakos = AstakosClient(AUTHENTICATION_URL, TOKEN)
-    USER_UUID = astakos.user_term('uuid')
+    USER_UUID = astakos.user_info['uuid']
 
     PITHOS_URL = astakos.get_service_endpoints('object-store')['publicURL']
     pithos = PithosClient(PITHOS_URL, TOKEN, USER_UUID, IMAGE_CONTAINER)
index 68c77cd..309e2b6 100644 (file)
@@ -56,6 +56,13 @@ class AstakosClient(OriginalAstakosClient):
             self.get_endpoints(), ep_type=service_type, ep_version_id=version)
         return services[0]['endpoints'][0] if services else []
 
+    @property
+    def user_info(self):
+        return self.authenticate()['access']['user']
+
+    def user_term(self, term):
+        return self.user_info[term]
+
 
 def _astakos_error(foo):
     def wrap(self, *args, **kwargs):