]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Remove obsoleted metadata files
authorTomas Sedovic <tomas@sedovic.cz>
Sat, 5 May 2012 01:00:16 +0000 (03:00 +0200)
committerTomas Sedovic <tomas@sedovic.cz>
Sat, 5 May 2012 01:00:16 +0000 (03:00 +0200)
Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
heat/metadata/api/v1/metadata.py
heat/metadata/db.py [deleted file]

index 77fc7ad52dbc06abee97e5b781399a68488ac96b..b0fe3edc760766872dc16a2d447d08f26758c210 100644 (file)
@@ -20,9 +20,6 @@ from webob.exc import Response
 
 from heat.common import wsgi
 from heat import context
-from heat.metadata import db as db_api
-from heat.metadata.db import (ConflictError, StackNotFoundError,
-                              ResourceNotFoundError)
 from heat import rpc
 
 
diff --git a/heat/metadata/db.py b/heat/metadata/db.py
deleted file mode 100644 (file)
index 732422c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-DB = {}
-
-
-class ConflictError(Exception):
-    pass
-
-class StackNotFoundError(Exception):
-    pass
-
-class ResourceNotFoundError(Exception):
-    pass
-
-
-def list_stacks():
-    return DB.keys()
-
-def create_stack(name, stack):
-    global DB
-    if name in DB:
-        raise ConflictError(name)
-    data = {}
-    # TODO(shadower): validate the stack input format
-    data['name'] = name
-    data['heat_id'] = stack['id']
-    data['resources'] = {}
-    DB[name] = data
-    return data
-
-def list_resources(stack_name):
-    if not stack_name in DB:
-        raise StackNotFoundError(stack_name)
-    stack = DB[stack_name]
-    try:
-        resources = stack['resources'].keys()
-    except:
-        resources = []
-    return resources
-
-def get_resource(stack_name, resource_id):
-    if not stack_name in DB:
-        raise StackNotFoundError(stack_name)
-    stack = DB[stack_name]
-
-    if not resource_id in stack['resources']:
-        raise ResourceNotFoundError(resource_id)
-    return stack['resources'][resource_id]
-
-def create_resource_metadata(stack_name, resource_id, metadata):
-    if not stack_name in DB:
-        raise StackNotFoundError(stack_name)
-    stack = DB[stack_name]
-
-    if resource_id in stack['resources']:
-        raise ConflictError(resource_id)
-    stack['resources'][resource_id] = metadata
-
-def update_resource_metadata(stack_name, resource_id, metadata):
-    if not stack_name in DB:
-        raise StackNotFoundError(stack_name)
-    stack = DB[stack_name]
-
-    if not resource_id in stack['resources']:
-        raise ResourceNotFoundError(resource_id)
-    stack['resources'][resource_id] = metadata