summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDolph Mathews <dolph.mathews@rackspace.com>2011-07-21 10:55:26 -0500
committerDolph Mathews <dolph.mathews@rackspace.com>2011-07-21 10:55:26 -0500
commit77e5404afeea308902f28f15959654e34e20e8ad (patch)
treeeb39acd33bcb445e6cc8071117b0f86c55b834c1
parent9cd5caff10cd9de9357efccba396914bb62e8554 (diff)
Assigned Base API classes so downstream code knows what to expect
-rwxr-xr-xkeystone/backends/api.py71
1 files changed, 34 insertions, 37 deletions
diff --git a/keystone/backends/api.py b/keystone/backends/api.py
index 34bf3b21..1814fae5 100755
--- a/keystone/backends/api.py
+++ b/keystone/backends/api.py
@@ -12,43 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-#API
-#TODO(Yogi) Refactor all API to separate classes specific to models.
-endpoint_template = None
-group = None
-role = None
-tenant_group = None
-tenant = None
-token = None
-user = None
-
-
-# Function to dynamically set module references.
-def set_value(variable_name, value):
- if variable_name == 'endpoint_template':
- global endpoint_template
- endpoint_template = value
- elif variable_name == 'group':
- global group
- group = value
- elif variable_name == 'role':
- global role
- role = value
- elif variable_name == 'tenant_group':
- global tenant_group
- tenant_group = value
- elif variable_name == 'tenant':
- global tenant
- tenant = value
- elif variable_name == 'token':
- global token
- token = value
- elif variable_name == 'user':
- global user
- user = value
-
-
#Base APIs
class BaseUserAPI(object):
def get_all(self):
@@ -306,3 +269,37 @@ class BaseEndpointTemplateAPI(object):
def endpoint_delete(self, id):
raise NotImplementedError
+
+#API
+#TODO(Yogi) Refactor all API to separate classes specific to models.
+endpoint_template = BaseEndpointTemplateAPI()
+group = BaseGroupAPI()
+role = BaseRoleAPI()
+tenant_group = BaseTenantGroupAPI()
+tenant = BaseTenantAPI()
+token = BaseTokenAPI()
+user = BaseUserAPI()
+
+# Function to dynamically set module references.
+def set_value(variable_name, value):
+ if variable_name == 'endpoint_template':
+ global endpoint_template
+ endpoint_template = value
+ elif variable_name == 'group':
+ global group
+ group = value
+ elif variable_name == 'role':
+ global role
+ role = value
+ elif variable_name == 'tenant_group':
+ global tenant_group
+ tenant_group = value
+ elif variable_name == 'tenant':
+ global tenant
+ tenant = value
+ elif variable_name == 'token':
+ global token
+ token = value
+ elif variable_name == 'user':
+ global user
+ user = value